better-redddit

1.2.6 • Public • Published

better-redddit

Simple Reddit API, no authentication needed! All credits go to normanlol for the original code, I just changed it to promises and used a different web scraper. Link to original https://github.com/normanlol/redddit and npm https://www.npmjs.com/package/redddit

example code

const r = require('better-redddit');

r.top_posts("memes", 10).then(results => {
	const post = results[Math.floor(Math.random() * results.length)].data.permalink;
	console.log(post);
	r.get_post(post).then(post_info => {
		console.log(post_info);
	});
});

r.search('memes', 10).then(results => {
	console.log(results);
});

r.get_url('r/PewdiepieSubmissions/comments/kseegx/im_bad_at_titles/').then(result => {
	console.log(result);
});

Readme

Keywords

Package Sidebar

Install

npm i better-redddit

Weekly Downloads

1

Version

1.2.6

License

UNLICENSED

Unpacked Size

4.74 kB

Total Files

5

Last publish

Collaborators

  • neronii