reddit-api-client
Barebones Reddit API client for Node.js. Just pass in your credentials and make
requests yourself by passing the url and the params needed for the call.
https://www.reddit.com/dev/api
is your friend, no classes and no sugar
included.
usage
npm i reddit-api-client
const RedditClient = require('reddit-api-client');
const r = new RedditClient({
"redditKey": "XXXXXXXXXXXXXX",
"redditSecret": "YYYYYYYYYYYYYYYYYYYYYYYYYYY",
"redditUser": "ZZZZZZZZZZZZZZ",
"redditPass": "TTTTTTTTTTTTTTTTTTTT",
"redditUserAgent": "QQQQQQQQQQQQQQ"
});
r.get('/r/node/new', {
query: {
limit: 10
}
}, (err, res) => {
if (err) { throw err; }
res.body.data.children.forEach(c => {
const { data } = c;
console.log(data);
});
});
Checkout the /example
folders for more examples and advanced usage. Read
the source code as well (100ish LOC).
license MIT
https://alessioalex.mit-license.org/