Monday, March 24, 2008

Google Gadget + OpenSocket = Facebook app

I converted my scifAI Google Gadget to a Facebook app via OpenSocket. It was a relatively painless procedure, though I did have to make allowances for the way Facebook rendered the app. Also, the code generated by OpenSocket still has some issues with the app's canvas height, so I also added the comments for a particular post just to use some of the extra space.

My pet peeve is that an iframe app in Facebook needs a "screenshot" that must be clicked before the app is activated. I don't know if this is a technical or business requirement, but it sure makes the end-user experience suck. I guess it's time to learn FBML.

Put it in your Facebook profile here or view the source code here.

more > | full >>

Friday, March 21, 2008

scifAI Google Gadget

In celebration of World Poetry Day (right...), I published my first Google Gadget, for scifAI. Here it is:

Drop this on any web page using the code generated here.

You can, of course, add this to your iGoogle page as well. Go ahead, you know you want to. ;-)

Source code is over here. (Smaller version here, code here.)

more > | full >>

Tuesday, March 18, 2008

Gari's birthday

It's Gari's birthday... yey! Happy birthday, bro!

Had a great time with the most of the gang (hi Togz!) last Sunday at Clint's place in Antipolo. Thanks, Clint... finally! ;-)

Sa uulitin!

more > | full >>

Monday, March 10, 2008

Tumblr hack: A real tag cloud

Tumblr may come up with "real" tag browsing soon, but meanwhile, here's a tag cloud that -- unlike third party services -- uses the actual tags that you assign to your posts.

Basically, the script calls the Tumblr JSON API and processes the posts, 50 at a time (the maximum allowable; configurable). It saves the tags, URLs, and a bit of the content. If there are any remaining posts, it keeps on doing this until it retrieves all of them, or reaches a preset maximum (150 by default, or thrice). It then renders the tags in varying font sizes depending on the total number of times each tag was used.

By default, links are created for each of the tags. Clicking on a tag will generate a list of posts with that particular tag. [ Hey Tumblr! A /tags/<tagname> path that only shows posts with that tag would be nice. :-) ]

I used Jason Levitt's Dynamic Script Tag class to call the Tumblr API as many times as required.

Here's*** the quick-and-dirty demo script showing the tags from my scifaiku site (again). If you do use it, please send me your URL via a comment. :-)

*** Update: The original one didn't use the titles (I had no titles in scifAI, originally) but instead parsed the content up to the first HTML tag. Here is a more generic one, using post titles.

more > | full >>

Tumblr hack: Author's Notes via Google Docs

This is a very basic HOWTO on retrieving a particular item in a Google Docs spreadsheet from your blog (not necessarily Tumblr), something that I could have used a few days ago. I use this over at my scifaiku site to show author notes for particular posts. *


  1. Create a new spreadsheet

  2. Use the first row to label the fields

  3. Enter some data

  4. Publish the spreadsheet

  5. Go to More publishing options

  6. Select RSS from the File format dropdown

  7. Click Generate URL and copy the resulting URL

  8. Modify the URL from something like
    http://spreadsheets.google.com/feeds/list/
    o<numbers>.<numbers>/od6/public/basic?alt=rss


    to something like (one line)

    http://spreadsheets.google.com/feeds/list/
    o<numbers>.<numbers>/od6/public/basic?
    alt=json-in-script&callback=notesLoaded&sq=postid%3D{PostID}


    where sq is a structured query (in this case, the postid field must be equal to the current Tumblr post id)

  9. Create a JSON call using the above URL, and put this near </body> (one line):

    <script src="http://spreadsheets.google.com/feeds/list/
    o<numbers>.<numbers>/od6/public/basic?
    alt=json-in-script&callback=notesLoaded&sq=postid%3D{PostID}" type="text/javascript"></script>

  10. Specify an output location using a named div
    <div id="authnotes_load"></div>

    If you want a nice "loading" animation to put inside this div, get one from ajaxload.info

  11. Write the callback handler:
    function notesLoaded(obj) {
    var notediv = document.getElementById('authnotes_load');
    if(typeof(obj['feed']['entry']) != 'undefined') {
    // 10 length of 'authnote: ', the first column
    var note =
    obj['feed']['entry'][0]['content']['$t'].substring(10);
    notediv.innerHTML = "<p><span>author's notes :"
    + "</span> " + note + "</p>";
    } else
    notediv.innerHTML = '';
    }

Adjust the above to taste. Enjoy!

You can see this in action here. A modified version is used at the main scifAI page ("42").

* Update: Deprecated in favor of just using Disqus comments.

more > | full >>

Tuesday, March 4, 2008

BCD = Silay City

If you're traveling to Bacolod City, you should know that the Bacolod City Domestic Airport is no more. The new Bacolod-Silay City International Airport, over 17.5 kilometers away as the crow flies, serves in its stead. It is a modern facility featuring such amenities as a working conveyor belt. ;-)

Despite the extra 40 to 70 minutes of travel time, I suppose I should be glad that Bacolod will now be able to put up tall buildings. In May 1994, for example, the fourth floor of the Sugarland Hotel had to be demolished so it wouldn't pose a hazard to airplanes.


If you find yourself without transportation, I recommend Nyala Tours. It's only P100 for the airconditioned shuttle bus/van from Silay Airport, and P150 from Bacolod to Silay. I actually added P50, both ways, as they dropped me off only a block from my home (the inner streets were too narrow), and was the only paying passenger on the return trip. Contact them at nyala_bacolod at yahoo, or +63(34) 434-4589, 433-1049 for advance booking.

more > | full >>

meanwhile, over at alexandr...