Git Product home page Git Product logo

node-hnapi's Introduction

Hacker News (unofficial) API

Yet another unofficial API for Hacker News. Currently being used by my other project. Feel free to fork and contribute.

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.

Deploy

Quick Start

  1. git clone this repo.
  2. cd to repo folder.
  3. Optionally download, install and start redis or memcached.
  4. npm install
  5. node server.js
  6. Load localhost in your web browser.

Configuration

HNapi uses nconf for configuration, which can be done via the config.json file, environment variables and command-line arguments.

  • port - (default: 80) Server port
  • cache_exp - (default: 600) Cache expiry in seconds
  • log_referer - (default: false) Logs referers
  • log_useragent - (default: false) Logs user-agent strings
  • cache
    • memory - (default: true) Use in-memory caching
    • store - (memcached | redis, default: none) Specify the cache store
    • options - Options for specified cache store
      • servers - HOST:PORT for memcached server
      • url - redis://USERNAME:PASSWORD@HOST:PORT for redis server
      • debug - (default: false) Allows debugging (only for redis store)
  • papertrail - for logging with Papertrail
    • host
    • port
    • hostname (optional) - host name for the server
  • universal_analytics - for logging with Google Analytics' Universal Analytics' Measurement Protocol
    • tid - tracking ID

License

Licensed under the MIT License.

Other APIs

node-hnapi's People

Contributors

cheeaun avatar burntcookie90 avatar julien-c avatar mbmccormick avatar christiangenco avatar siong1987 avatar premii avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.