Snoocore
A minimal and complete JavaScript driver for the Reddit API.
Quick Start
Install
npm install snoocore
|| bower install snoocore
Examples
Quick Demo
Get "hot" posts site wide or from a specific subreddit.
var Snoocore = require('snoocore');
var reddit = new Snoocore({ userAgent: 'myApp v0.0.0' });
var frontpagePromise = reddit('/hot').get();
var netsecPromise = reddit('/r/$subreddit/hot').get({
$subreddit: 'netsec',
limit: 10
});
- See Basic Usage for an explanation on calling endpoints with parameters, URL parameters (as in
$subreddit
above), and more. - Check out a basic overview of promises if you're not familiar with them. Every call to snoocore will return one.
Features
All endpoints are supported
Calls are dynamically generated from the Reddit API documentation. Undocumented endpoints are supported as well.
No special syntax or fluff
All calls follow the reddit API directly. To use the endpoint GET /api/v1/me
, call:
reddit('/api/v1/me').get()
For routes that take parameters and url parameters, see the basic usage section of the documentation.
Node.js and Browser support
npm install snoocore
|| bower install snoocore
The same syntax can be used in node and in browser based JavaScript. There are a few limitations & restrictions for browser based environments covered in the documentation.
Login Helpers
Both OAuth and Cookie based logins are supported.
Throttling
Rate limiting is built into snoocore but can be adjusted or removed all together in the configuration settings.