diff --git a/README.md b/README.md index ecfc9f6..19ced09 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,34 @@ -# Node.js NPR API [![Build Status](https://travis-ci.org/adafruit/npr.svg?branch=master)](https://travis-ci.org/adafruit/npr) +# Node.js NPR API [![Build Status](https://travis-ci.org/adafruit/node_npr.svg?branch=master)](https://travis-ci.org/adafruit/node_npr) A Node.js wrapper for NPR APIs. ## Installation ``` -npm install npr +$ 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 +``` +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); + ``` diff --git a/package.json b/package.json index cf7d178..5d3f5a6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "npr", + "name": "npr-api", "version": "0.1.0", "description": "Node.js NPR API client", "main": "index.js", @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/adafruit/npr.git" + "url": "git+https://github.com/adafruit/node_npr.git" }, "keywords": [ "npr", @@ -20,9 +20,9 @@ "author": "Todd Treece ", "license": "MIT", "bugs": { - "url": "https://github.com/adafruit/npr/issues" + "url": "https://github.com/adafruit/node_npr/issues" }, - "homepage": "https://github.com/adafruit/npr#readme", + "homepage": "https://github.com/adafruit/node_npr#readme", "devDependencies": { "gulp": "^3.9.0", "gulp-jshint": "^1.11.2",