A Node.js library for seamless integration with Algolia's kickass Hacker News API.
npm install hacker-news-api
Some methods only require a callback.
var hn = require('hacker-news-api');
hn.getLastPolls(function (error, data) {
if (error) throw error;
console.log(data);
});
Some methods require a string and a callback.
var hn = require('hacker-news-api');
hn.getUserStories('pg', function (error, data) {
if (error) throw error;
console.log(data);
});
Some methods require an object and a callback.
var hn = require('hacker-news-api');
hn.search({
query: 'javascript',
tags: 'poll'
}, function (error, data) {
if (error) throw error;
console.log(data);
});
getComments(cb)
getLastComments(cb)
;getPolls(cb)
getLastPolls(cb)
getPosts(cb)
getLastPosts(cb)
getStories(cb)
getLastStories(cb)
getItem(id, cb)
getUser(username, cb)
getUserComments(username, cb)
getLastUserComments(username, cb)
getUserPolls(username, cb)
getLastUserPolls(username, cb)
getUserStories(username, cb)
getLastUserStories(username, cb)
searchComments(query, cb)
searchLastComments(query, cb)
searchPosts(query, cb)
searchLastPosts(query, cb)
searchStories(query, cb)
searchLastStories(query, cb)
search(obj, cb)
searchLast(obj, cb)