hacker-news-stream

1.0.0 • Public • Published

hacker-news-stream Build Status

The Hacker News top stories but in Streams.

Install

$ npm install hacker-news-stream --save-dev

Usage

var hackerNews = require('hacker-news-stream');
var stream = hackerNews().getStory(11218732);
 
stream.on('data', function(res) {
  var story = JSON.parse(res);
  console.log(story);
});

Output:

$ node example/stream.js
{
  by: "schakraberty",
  descendants: 3,
  id: 11218732,
  kids: [11219282],
  score: 11,
  time: 1457029231,
  title: "How Duolingo got 110M users",
  type"story",
  url: "https//www.techinasia.com/how-duolingo-got-110-million-users"
}

Methods

getStory(id)

Find one story by id and return a readable stream.

getStories()

Find all top stories ids and return a readable stream.

Contributions

Pull requests and issues will be appreciated.

License

MIT license

© 2016 José Luis Quintana

Package Sidebar

Install

npm i hacker-news-stream

Weekly Downloads

7

Version

1.0.0

License

MIT

Last publish

Collaborators

  • joseluisq