A YQL (Yahoo Query Language) client that uses promise/future objects
yqlp module is a YQL client for node.js inspired by the
node-yql module by Derek Gathright.
This fork builds upon the previous work primarily through the introduction of
YQL.execp that returns a
promise rather than using a
Aside from adding promises, the main
YQL.exec signature has been modified to
more closely follow the Continuation-passing Style (CPS),
callback pattern used by most of the node community.
For a nice introduction to the node
callback convention I recommend reading
the post, Callback conventions in node.js, how and why
callbackfunction is now the last argument passed to
callbackfunction uses the standard nodejs pattern of
callbackparameter is mandatory on the
YQL.execp()- doesn't take a callback, but returns a Q promise, see: https://github.com/kriskowal/q/
Yahoo! Query Language is an expressive SQL-like language that lets you query, filter, and join data across Web services. With YQL, apps run faster with fewer lines of code and a smaller network footprint.
Yahoo! and other websites across the Internet make much of their structured data available to developers, primarily through Web services. To access and query these services, developers traditionally endure the pain of locating the right URLs and documentation to access and query each Web service.
With YQL, developers can access and shape data across the Internet through one simple language, eliminating the need to learn how to call different APIs.
You may find more examples at the YQL console
First, make sure you have Node installed. You can find instructions for installing it at http://nodejs.org/#download
With Node installed, you can install the
yqlp module 2 ways:
The easiest method is to use NPM, node's package manager. Once you have NPM installed, simply run:
$ npm install yqlp
Or, you can clone the github repository, and just be sure you add this module's path to the $NODE_PATH env variable
$ git clone https://github.com/alchemycs/yqlp.git
Basic examples (
npm run-script examples):
var YQL = ;//Example #1 - Parameter Binding using callbackYQL;// Example #2 - Parameter binding + SSLYQL;//Example #3 - Parameter Binding using promiseYQL;// Example #4 - Parameter binding + SSL with promiseYQL;
function exec (string query [, object params] [, object httpOptions] [, function callback(error, result) ])
erroris set if something went wrong, otherwise
resultcontains the response
promise object function execp (string query [, object params] [, object httpOptions])