Package Exports
- reddit-by-date
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (reddit-by-date) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
reddit-by-date
Node.js API to get top Reddit posts by date
install
npm install reddit-by-dateexample
var redditByDate = require('../reddit-by-date.js');
// month, day, year, subreddit
// month [ 0 -> 11 ] = [ January -> December ]
redditByDate.getPosts(3, 4, 2016, "news", function(err, posts){
console.log(posts);
});api
getPosts(month, day, year, subreddit, callback)
Type: function
month number (integer from 0 to 11)
day number (integer from 0 to 31)
year number (integer)
subreddit string (name of subreddit)
callback function
Returns array of top posts in subreddit for requested date.
posts
Type: array
Post objects.
postObject.subreddit
Type: string
Name of subreddit.
postObject.id
Type: string
ID of subreddit.
postObject.author
Type: string
Author of post.
postObject.name
Type: string
Unique name identifier of subreddit (e.g. t3_4d7lw5).
postObject.score
Type: number
Score of post.
postObject.subreddit_id
Type: string
Unique subreddit identifier of subreddit (e.g. t5_2qh3l).
postObject.downs
Type: number
Number of downvotes on post.
postObject.ups
Type: number
Number of upvotes on post.
postObject.permalink
Type: string
Permalink of post.
postObject.created
Type: number
Time of creation in milliseconds from January 1, 1970.
postObject.url
Type: string
URL referenced by post.
postObject.title
Type: string
Title of post.
postObject.num_comments
Type: number
Number of comments on post.
postObject.subreddt_type
Type: string
Type of subreddit.
license
MIT © Rishi Masand
