Sunday, May 03, 2009

adventure with yahoo yql: part 1

Not too long ago, yahoo have release yql. What it does is, it query data from webservice, in a SQL like language. So you can have query like,

select * from tablename
use tablename
desc tablename
There is other query like join, and subquery, etc. But all the yql is read only.

To use the query, you can actually
First, you can use the query console, here. But the query is limited to build in tables from yahoo. Which expose data from yahoo api.

Above is the query console, with build in tables from yahoo, or a more interesting one is here. This actually use table from community made table.
Now you can not just can query yahoo's api, you can query weather data, twitter data, etc

The community made table is hosted at

Which is host at http://datatables.org/ with links to the table hosted on github too.

Another way is to use the REST based interface. For example
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20search.web%20where%20query%20in%20(select%20title%20from%20rss%20where%20url%3D%22http%3A%2F%2Frss.news.yahoo.com%2Frss%2Ftopstories%22%20%7C%20truncate(count%3D1))%20limit%201&format=xml

Which is a bit of a handful. Which you should write a program to do so.

More can be found in the documentation here.

2 comments:

  1. hey,
    Your post are informative, nice work pal.
    Do you have any idea of how to get contact list from a Yahoo mail ,My application is not interested in BBAuth .When user enters Id and password in my site i need to present their contact list .i would appreciate any post in this regard.

    ReplyDelete
  2. i am pretty much stuck as well,
    but it worth investigating...

    ReplyDelete