HackerNews API
An unofficial API for Y Combinator's HackerNews written in Node.
About
The API is currently in early stages, developed for HN-App - a mobile version of HackerNews.
Please note I am not affiliated with Y Combinator in any way.
##Running the application
$ node app.js
Express server listening on port 3000
Then navigate to localhost:3000
##Accepted Commands
###Getting Links
localhost:3000/links
-- Front page linkslocalhost:3000/links/news2
-- Second page linkslocalhost:3000/links/newest
-- Most recent linkslocalhost:3000/links/ask
-- Ask linkslocalhost:3000/links/x?fnid=JwXpfFQtQt
-- Valid next page links
####Returns:
items
-- Array containing each individual post's details:title
-- post titleurl
-- post linkdomain
-- the domain, i.e "(imgur.com)"points
-- post pointsby
-- post authorcomments
-- number of commentsdate
-- how old the post isid
-- unique post id
nextID
-- fnid for next page of links
###Getting Comments
localhost:3000/post/4543202
-- Retrieve comments
####Returns:
comments
-- Array containing each individual comment's details:text
-- comment textby
-- comment authordate
-- how old the comment isindent
-- indentation level of commentid
-- unique comment id
post
-- Array containing the post's details:title
-- post titleurl
-- post linkdomain
-- the domain, i.e "(imgur.com)"points
-- post pointsby
-- post authorcomments
-- number of commentsdate
-- how old the post ispostid
-- unique post id
Development
The application is built using Node. Data is scraped live from HN, parsed and returned as a JSON object: