No description
Find a file
2015-08-01 23:39:28 -04:00
lib a couple small tweaks to the promisify helper 2015-08-01 23:25:02 -04:00
test adds listening tests 2015-08-01 23:25:27 -04:00
.gitignore adds gitignore & npm package.json 2015-07-31 15:52:47 -04:00
.travis.yml adds travis 2015-08-01 20:04:08 -04:00
gulpfile.js adds travis 2015-08-01 20:04:08 -04:00
index.js adds main npr module 2015-08-01 20:06:15 -04:00
LICENSE adds license 2015-08-01 23:38:26 -04:00
package.json updates README with example & changes package name to npr-api 2015-08-01 23:23:39 -04:00
README.md updates readme with license and dependency info 2015-08-01 23:39:28 -04:00

Node.js NPR API Build Status

A Node.js package for accessing NPR APIs.

Requirements

This module is a npm package, and requires the latest stable version of node.js.

$ node -v
v0.12.7

Installation

$ mkdir npr_test && cd npr_test
$ npm install npr-api

Usage

As of right now, the full NPR One API is available in this package. There are more examples in the test directory.

Example: getting recommendations for your user

// paste into a file called index.js,
// and edit the credentials to match
// your account info.
var NPR = require('npr-api');

var npr = NPR({
  client_id: 'your_client_id',
  client_secret: 'your_client_secret',
  username: 'your_username',
  password: 'your_password'
});

npr.one.init()
  .then(npr.one.listening.getRecommendations({ channel: 'npr' }))
  .then(function(recommendations) {
    console.log(recommendations);
  }).catch(console.err);

Then you can run this example by running:

$ node index.js

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.

License

Copyright (c) 2015 Adafruit Industries. Licensed under the MIT license.