Yet another unofficial API for Hacker News. Currently being used by my other project. Feel free to fork and contribute.
- API: http://node-hnapi.herokuapp.com/
- API Documentation: https://github.com/cheeaun/node-hnapi/wiki/API-Documentation
NOTE: If you are planning to scrape a huge amount of posts or (historical) data from HN, please don't use this API. Use the official Hacker News API or HN Search API instead.
git clonethis repo.cdto repo folder.- Optionally download, install and start redis or memcached.
npm installnode server.js- Load
localhostin your web browser.
HNapi uses nconf for configuration, which can be done via the config.json file, environment variables and command-line arguments.
port- (default:80) Server portcache_exp- (default:600) Cache expiry in secondslog_referer- (default:false) Logs refererslog_useragent- (default:false) Logs user-agent stringscachememory- (default:true) Use in-memory cachingstore- (memcached|redis, default: none) Specify the cache storeoptions- Options for specified cache storeservers-HOST:PORTfor memcached serverurl-redis://USERNAME:PASSWORD@HOST:PORTfor redis serverdebug- (default:false) Allows debugging (only for redis store)
papertrail- for logging with Papertrailhostporthostname(optional) - host name for the server
universal_analytics- for logging with Google Analytics' Universal Analytics' Measurement Protocoltid- tracking ID
Licensed under the MIT License.
