inputEx - YQL-trimpath-page

back to the inputEx library

Introduction


This utility makes it easy to use the Yahoo! Query Language (YQL) from web pages.

YQL Execute gives the ability to execute JavaScript on Yahoo!'s platform, with a very powerful API to query the web.



We combine this new backend with client-side templating using Trimpath templates.



To use this utility, you will need to be familiar with the trimpath templates syntax and the yql api.

Furthermore, we provide an editor, based on YUI Grids CSS builder, to create pages from YQL code + trimpath templates.



Demo


Here is a custom example: example using a flickr query, YQL logging and diagnostics, and custom javascript handler.



Usage


Add YQL Execute code in script tags with a type set to "text/yql".

Add them at the end of your body tag ; This code will run on the Yahoo! YQL platform.

Add templates in your code in script tags with a type set to "text/trimpath".

The result of this template will be inserted where the script tag is in the dom.

The src attribute must be set to the index of the YQL query ("#0" for the first query).

In your templates, the results are accessible through the "query" object.

You can add multiple template script tags at various places in your dom for the same YQL query.



You will also need to install the javascript dependencies : YUI utilities and json, the trimpath-template library, 3 files from inputEx + a line to run the trimpath page utility.

You can also add custom javascript handlers for each query (You may want to use widgets for advanced visualization)

Behind the scene


We generate a YQL XML through: http://javascript.neyric.com/yql/. (like this one)

Then, we build a YQL query, to use this XML file : (actually the xml file is requested by YQL servers)

We finally get the results of this query through JSON-P.



Enjoy !