Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

agilecreativity/hn-reader

Repository files navigation

hn-reader

https://img.shields.io/clojars/v/hn-reader.svg

https://jarkeeper.com/agilecreativity/hn-reader/status.svg

Access to all of the latest news from Hacker News.

Installation and basic usage as CLI

Pre-requisites

Basic Installation

# Clone this repository locally
mkdir -p ~/projects

git clone https://github.com/agilecreativity/hn-reader.git ~/projects/hn-reader

cd ~/projects/hn-reader

# Create the `~/bin` folder to hold the executable
mkdir -p ~/bin

# Generate the standalone using `lein bin`
lein bin

Usage

To see the help just type

~/bin/hn-reader

This should give you the help like

Extract the lastest Hacker News index to a single file

Usage: hn-reader [options]
  -p, --page-count PAGE-COUNT    20
  -o, --output-file OUTPUT-FILE  hacker-news.org
  -h, --help
Options:

--p PAGE-COUNT  the number of pages to be extracted default to 20
--o OUTPUT-FILE the output file name default to 'hacker-news.org'

Now get the list of all news from Hacker News

# Get only the first page from the site
~/bin/hn-reader --page-count 1 --output-file hacker-news-front-page.org

# Get all of the news (20 pages) using shorter option
~/bin/hn-reader -p 20 -o hacker-news-top-20-pages.org

Example Sessions and Outputs

Sample sessions

https://asciinema.org/a/d2coJsZNP2L8oPSGjEHFt5Nti.png

Sample output in Org-Mode format

First 12 pages of HackerNews (Emacs Org Mode) All 20 pages of HackerNews (Emacs Org Mode)

Useful Links

License

Copyright © 2016-2018 Burin Choomnuan

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.