Dreams of Thought

Are dreams thoughts… or are thoughts dreams..

RSS Feed

Monthly Archives: September 2009

Pirate tweet

0 Comments

September 19 is International Talk Like a Pirate Day.For this day, the Yahoo! Query Language (YQL) team announced on the YDN blog that they were bringing out a “pirate table”. This table would allow us to translate plain English to piratespeak using YQL. I had been meaning to play around with YQL a bit and took this opportunity to dive in. I couldn’t complete it in time for September 19 because of work, but managed to finally get it in some shape today. What I made is something I call “Pirate Tweet”.

Pirate tweet allows you to read your most recent tweets in piratespeak. Just enter a twitter username and you get the tweets in piratespeak. You can get the source at http://labs.gingerjoos.com/piratetweet/piratetweet.tar.gz . Please do link back to this post if you do use it. It is written in PHP and uses PHP’s builtin SimpleXML as well as libcurl. What is in there is just a rough basic barebones quick-and-dirty stuff. It includes an index.php file which takes care of spitting out the actual html. The common.php file does the actual processing. pirate-tweet.css file is some very basic css.

The twitter RSS feed for a user is something like http://twitter.com/statuses/user_timeline/USERNAME.rss . This is fed into the YQL query which does the translation, like this

SELECT * FROM piratespeak.translate
WHERE html IN 
(SELECT description FROM rss 
WHERE url = "http://twitter.com/statuses/user_timeline/USERNAME.rss")

.
So you send this query to http://query.yahooapis.com/v1/public/yql with the params

<code>$params = array (
'q'      => $query,
'format' => 'xml',
'env'    => 'store://kid666.com/piratespeak',
);

So that’s basically what it does. Hope someone finds this useful :)

I must say that YQL seems like a very interesting tool. Hopefully the MS – Yahoo! deal will have no negative impact on it. Without doubt, YQL is the star in Yahoo!’s products for developers. The ability to express data as queries is mind – blowing. Looking forward to doing more stuff with YQL.

Known issues :

Even links are passed as is to the YQL query. This results in, for example, http://is.gd/3oBWf to become http://be.gd/3oBWf .

Acknowledgment :
Much thanks to the YQL guys at Yahoo! and their wonderful documentation.

Also see :

Previously mentioned blog post has some more stuff using the same table.

Chris Heilmann made some stuff with the table as well. Do check it out.

Filed under code
Sep 28, 2009

Gingerjoos.com visitor stats on a map

0 Comments

My friend Arun Prabhakar recently started playing around with some visitor stats reporting for his site. He has been gracious enough to extend the service to his friends and now the public as well(by invitation only) :) The service is still in beta, so occassional hiccups might occur. He’s been adding more and more tools to complement the visitor count. You can check out the stats on the right sidebar of this blog. So if you want to put in a nice stat counter for your blog or website, head over to http://stats.kitiyo.com/.

He’s just completed a see-your-visitors-on-a-map feature. Here’s what it looks like for this blog.

visitors to gingerjoos.com blog

visitors to gingerjoos.com blog

He has very kindly provided a limited-time special invitation code for Gingerjoos.com visitors :) Use the invitation code iwantitbadly to sign up for the service at Kitiyo stats.

Sep 10, 2009