Skip to content

cookpete/fetch-reddit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fetch-reddit

Build Status Dependency Status devDependency Status

A utility function for fetching links from subreddits or Reddit comment threads. Used by rplayr, an app to generate playlists from Reddit URLs.

Usage

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)
})

Linting

This project uses standard code style.

npm run lint

Testing

This project uses mocha with chai assertions for unit testing.

npm run test

Thanks

About

Easily fetch links from Reddit subs and threads

Resources

Stars

Watchers

Forks

Packages

No packages published