0.0.2 • Published 11 years ago

hacker-news-parser v0.0.2

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

#hacker-news-parser

Parses the insanely shitty html of hacker news comments into json

example

var hn = require('hacker-news-parser');
request("https://news.ycombinator.com/item?id=4992617", function(err, res) {
  if(err) throw err;
  var content = hn.parse(res.body);
  console.log(content.comments);

api

hn.parse(html)

parses the html of a hacker news post

returns {comments: [comment], more: moreLink} note: moreLink will be null if there is no 'more' link at the bottom

comment

represents a single comment

body

raw html body of the comment

date

utc date of the comment

href

url to the comment

moreLink

href

url to the next page of comments