Skip to content

A YQL helper module for NodeJS, includes OAuth access option

License

Notifications You must be signed in to change notification settings

AlbinDidic/yql-node

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yql-node

NPM

A small module providing utility methods for accessing YQL API. Provides optional OAuth access helper. Most other node modules for YQL failed for me on large query strings so this one uses POST method.

Installation

npm install yql-node --save

Usage

  //call public endpoints out of the box by simple require
  var yql = require('yql-node');
  //or set the instance to use OAuth and non-public endpoint like this
  var yqlWithOAuth = require('yql-node').withOAuth('CONSUMER KEY','CONSUMER SECRET');
  
  var query = 'select * from html where url="http://example.com"; ';

  //these two calls will produce same results
  
  //response passed to your callback will a string containing the YQL query result
  //so you read data straight from it
  
  yql.execute(query, function(error,response){
    console.log(response);
  });

  yqlWithOAuth.execute(query, function(error,response){
    console.log(response);
  });

Dependencies and credits

[needle] (https://www.npmjs.com/package/needle) [oauth] (https://www.npmjs.com/package/oauth)

Contributing

If you find yourself wishing for a feature it doesn't have - feel free to fork, add it and generate a pull request. All contributions welcome.

Licence

[MIT] (https://github.com/djordjelacmanovic/yql-node/blob/master/LICENSE)

Release History

  • 0.1.5 Bug fixes and example improvement
  • 0.1.0 Initial release

About

A YQL helper module for NodeJS, includes OAuth access option

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%