Skip to content
This repository has been archived by the owner on Sep 21, 2018. It is now read-only.

elazzabi/hacker-news-scrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hacker-news-scrapper

A Promise based, Hacker News scrapper

Install

$ yarn add hacker-news-scrapper

Or using npm:

$ npm install --save hacker-news-scrapper

Usage

import { page } from 'hacker-news-scrapper'

// Give the number of the page you want to scrap (default = 1)
page(2).then(data => {
    //data is an array of elements. Every element has:
    //{
    //    "title": "Linux Programming: Signals the easy way",
    //    "website": "stev.org",
    //    "link": "https://www.stev.org/post/linuxprogrammingsignalstheeasyway",
    //    "rank": "60",
    //    "score": "175 points",
    //    "user": "dkarapetyan",
    //    "age": "19 hours ago",
    //    "comments": "41 comments"
    //}
}).catch(err => {
    // Something bad happened
})

Contributing

Feel free to open an issue or make a pull request

Testing

$ npm test

Ava is used for test running

License

MIT © EL AZZABI Ahmed

About

A Promise based, Hacker News scrapper

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published