hackernews
v0.0.7
Published
Hacker News scraping for Node.js
Downloads
6
Readme
node-hackernews
A Hacker News scraper/bot for Node.js. Drink responsibly.
Module
npm install hackernews
Methods:
hackernews.popular([pageNumber = 1,] callback(err, json)) — Most popular stories.
hackernews.newest([pageNumber = 1,] callback(err, json)) — Newset submissions.
hackernews.story(id, [pageNumber = 1,] callback(err, json)) — Story and its comments.
hackernews.submitted(username, [pageNumber = 1,] callback(err, json)) — Stories submitted by a user.
hackernews.commented(username, [pageNumber = 1,] callback(err, json)) — Comments by a user.
hackernews.profile(username, callback(err, json)) — Profile of a user.
Authenticated calls require login()
, which returns a new, authenticated API object to its callback.
hackernews.login(username, password, callback(err, userAPI)) — Login as a user. Passes a new authenticated API object to the callback, with the above methods as well as:
hackernews.upvote(id, callback(err, json)) — Upvote an item.
hackernews.downvote(id, callback(err, json)) — Downvote an item.
hackernews.comment(id, text, callback(err, json)) — Comment on a post.
CLI hackernews
or hn
$ npm install -g hackernews
$ hackernews
$ hn # same thing
$ hn 4 # page 4