Skip to content

dinostheo/echonestjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

echonestjs

wercker status

Simple node.js client for querying the echonest api.

Installation

  npm install echonestjs --save

Usage

The echonestjs module exposes a singleton object, which you can initialize once with the api key, which is handy to use with application frameworks such as express.

  var Echonest = require('echonestjs');

  Echonest.init('YOUR ECHONEST API KEY');

  Echonest.get('echonest/endpoint', {'the necessary parameters'}, callback);

e.g.

  var Echonest = require('echonestjs');

  Echonest.init('123456789');

  Echonest.get('song/search', { artist: "led zeppelin" }, function (err, res) {
      if (err) {
        console.log(err);
      } else {
        console.log(res);
      }
  });

Tests

To run the tests simply execute:

    npm test

The tests have a dependency of a configuration file config/config.js of the following structure:

/**
 * Module configuration.
 *
 * Contains the echonest api key for the tests.
 *
 * config/config.js
 */
module.exports = {
    api_key: 'PLACE YOUR ECHONEST API KEY HERE'
};

Dependencies

request

About

Simple node.js client for querying the echonest api.

Resources

License

Stars

Watchers

Forks

Packages

No packages published