matthewlawson / hn-scraper

Hacker News Scraper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hacker News Scraper

Installing

Install the latest version of node and npm from node

It has been tested with node v6.10.0 and npm 3.10.10

Install Dependencies

$ npm Install

Running Tests

$ npm test

Final Setup

$ `alias hackernews='node index.js'

Run the app

$  hackernews --posts 12

3rd Party libraries

A number of 3rd party node libraries were used

App libraries

Used to validate and parse command line arguments

jQuery style DOM parsing. Used to extract properties from downloaded HN page.

Testing

Testing framework

BDD assertions for mocha. To have nice verbose assertions over nodes assert library.

Nock is an HTTP mocking and expectations library for Node.js.

To Do

  • Return full usage when tool is used incorrectly.
  • Better error handling when the page cannot be parsed.

About

Hacker News Scraper

License:MIT License


Languages

Language:HTML 85.0%Language:JavaScript 15.0%