Node.js wrapper for the Reddit API
- To create a nice node-friendly wrapper/client for the Reddit API.
- To learn how to create an API wrapper using superagent and request and share it using npm publish. (smackdown)
We'll look at npm publish and make the project available via
npm install _________ (project name here)
var Reddit = require('handson-reddit'); // working title
reddit = new Reddit();
reddit.r('funny', function (err, results) {
});
reddit.r('funny').new().exec(function (err, results) {
});
Support new(), controversial(), top()
reddit.login(username, password, function (err, success) {
});
Plus more calls from https://github.com/reddit/reddit/wiki
- So you never have to do it again.
- So other people can use it to do amazing things.
- Feedback, contributions, the whole community thing.
https://github.com/mikeal/request/
https://github.com/visionmedia/superagent/
http://nodejs.org/api/http.html#http_http_request_options_callback
git clone https://github.com/timisbusy/handson-reddit.git
cd handson-reddit
npm install
REDDIT_USERNAME=usernamehere REDDIT_PASSWORD=passwordhere make test
Check out the tests, check out a branch, make a test pass, submit a pull request, repeat.