A utility function for fetching links from subreddits or Reddit comment threads. Used by rplayr, an app to generate playlists from Reddit URLs.
npm install fetch-reddit --save
import { getPosts } from 'fetch-reddit'
function processPosts (posts) {
// Do something with the extracted posts
}
getPosts('/r/chillmusic').then(data => {
// Array of extracted posts
processPosts(data.posts)
// Easy pagination
data.loadMore().then(processPosts)
})
This project uses standard code style.
npm run lint
This project uses mocha with chai assertions for unit testing.
npm run test
- Big thanks to koistya for babel-starter-kit, which this repo is roughly based on.