Jamendo API client
jamendo
is a simple Jamendo API javascript wrapper.
It only makes HTTP requests with the well known request module.
All methods described at http://developer.jamendo.com/v3.0 are supported.
Install
$ npm install jamendo
Use
var Jamendo = ; var jamendo = ... ; jamendo;
{ id: '33',
name: 'Simple Exercice',
releasedate: '2004-12-28',
artist_id: '5',
artist_name: 'Both',
image: 'http://imgjam.com/albums/s0/33/covers/1.200.jpg',
zip: 'http://storage-new.newjamendo.com/download/a33/mp32/'
}
As methods return a request
object, they are streamable.
// write the track #245 in mp3 on diskjamendo;
Supported methods and workflows
All read methods are supported, see http://developer.jamendo.com/v3.0#readmethods-list
Write methods are supported, but this library WILL NOT HANDLE OAUTH2 for you.
You have to handle oAuth2 workflows by yourself.
That said, some methods can help:
jamendo; jamendo;
Once you have these oauth details, you can use write methods.
jamendo;
Syntax sugar
Jamendo API uses specific formats for some parameters. This wrapper library will take care of formatting for you.
Lists can be specified as arrays, so
jamendo
datebetween
parameter can be specified as arrays containing two bounds (as timestamps or Date objects), so
jamendo
Default values will be explicited, according to current API defaults, so
jamendo
Run tests
$ npm test
Write methods will be tested if you set a valid authorization code in the AUTHORIZATION_CODE
environement variable.
$ AUTHORIZATION_CODE=1234567890987654321 npm test
Run Grunt (jslint, docs)
$ grunt
Constructor settings
You can set following options in the settings
parameter
var jamendo = client_id : 'no default' // Specify your client_id // see http://developer.jamendo.com/v3.0#obtain_client_id protocol : 'http' // HTTP protocol to use, http or https version : 'v3.0' // Use the specified API version debug : false // Print the whole response object and body in the console rejectUnauthorized: false // Ignore SSL certificates issues // see TLS options http://nodejs.org/docs/v0.7.8/api/https.html;
Documentation
API documentation is built by grunt
and stored in the public/docs
directory
License
BSD
Contribute
All comments, patchs and pull requests are welcome, but please ensure you ran grunt
without warnings before creating a pull request.
Background
Maintainer @vincent (me duh!) was a Jamendo developper for about 4 years and still have relationships with Jamendo staff.