Saturday, July 25, 2009

YQL open data table

So that, you can use a service of YQL, you need to configure open data table. This table is in xml format which tells YQL what service that you want to expose and also it tells you also on how to use the service. Thus, this open data table will determine how is your query looks like.

YQL provides you 4 operations to deal with any public webservices, such as Twitter and Facebook. They are select, insert, update and delete. Yeps, pretty much similar with sql query. They are very powerful to deal with those public webservices.

I am gonna explain a little bit about those operations

  • select, this operation is to fetch data from webservices that you point in YQL. The things that you need to be aware is the format that you expect YQL to send to you. The available format are JSON, XML and the combination of both.
  • insert, this operation is to add/insert a new data through YQL.
  • update, this operation is to update certain data through YQL
  • delete, is to delete data in public webservice through YQL.
In SQL query, as we know, there are parameters, we need to supply so that they behave like what we expect. Below is the piece of code as an example:


The parameter of YQL is specified inside tag inputs. The thing that you really need to be aware is about the paramType. It determines how is the behaviour of the variable. paramType variable means that the input is accessible in javascript as the above. Yeah!!! it is one of the interesting thing of YQL, it allows you to do javascript to tackle the problem of basic authentication. It's nice, isnt it?

For a complete referece, you can see on YQL documentation. Overall, Its a gift to know that YQL comes. It is really helpful service.

No comments: