0.0.7 • Published 11 years ago

hackernews v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
11 years ago

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
0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago