Giter Site home page Giter Site logo

hn-downloader's Introduction

Hacker News downloader

Simple CLI app to download Hacker News database using API from https://github.com/HackerNews/API

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js

  • A MySQL server

Configuration

Install the dependencies

npm install

Prepare database schema: Import database.sql file that came with this repo
( Note: you must create an empty database first then USE it )

Change database.js according to your database credential

Update config.js to suit your preference (optional)

    concurrentFetch : 1000
    maxRetry        : 3
  • concurrentFetch number of items to download before insert into database
  • maxretry if a network error occured, how many times it will attempt to retry before giving up

You are all set!

Usage

image

node index.js [largestId]
  • largestId (optional) largest ID the script will download then stop, in case you just want to download a part of it.
    Leave it blank to download the whole database (takes several hours!)

Warning: [Aug/2017] Whole database is nearly 7GB. Make sure you have enough room for it.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

hn-downloader's People

Contributors

qduc avatar

Watchers

 avatar  avatar

hn-downloader's Issues

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.