Skip to content

Bunchhieng/hnreader

Repository files navigation

hnreader

hnreader (Hackernews Reader) allows you to open tech news feeds in your favorite browser from the command line.

Go Report Card Build Status Maintainability GitHub

Installation

  • Download the binary from the hndreader GitHub Release Page

    For example: To download and install version 1.1 for Linux, you may run the following.

    sudo curl -L https://github.com/Bunchhieng/hnreader/releases/download/v1.1/hnreader-v1.1.linux.x86_64 > /usr/local/bin/hnreader && chmod +x /usr/local/bin/hnreader
    
  • or install the Go package

    go get -u github.com/Bunchhieng/hnreader
    

    Note that this option requires you to have Golang already installed. You can install Go with your operation system's package manager or download it from golang.org/dl/.

    Don't forget to set your GOPATH and PATH environment variables:

    export GOPATH=/path/to/your/go/workspace
    export PATH=$GOPATH/bin:$PATH
    

Usage

To use hnreader with its default options (Opens 10 news sites with Chrome), simply run:

hnreader r

To see all available flags for each command:

hnreader help r

OR

hnreader help rr

There are a number of customization options:

   --tabs value, -t value     Specify number of tabs   (default: 10)
   --browser value, -b value  Specify browser
   --source value, -s value   Specify news source (one of "hn", "reddit", "lobsters", "dzone", "devto", "steemit")   (default: "hn")
   --help, -h                 show help (default: false)

Examples with options:

hnreader r -t 31 -b "firefox"
hnreader r -b "brave" -s "reddit"
hnreader r -b "firefox" -s "reddit" -t 20

To use hnreader with a randomized source of news, run:

hnreader rr

The following options are available:

--tabs value, -t value Specify value of tabs (default: 10)
--browser value, -b value Specify browser

Tip: Create a bash alias (for Linux and macOS), if you are going to run the same command every morning. You can do so by adding the following line (with your preferred options) to the end of your ~/.bashrc file:

alias hnr='hnreader r -b "firefox" -s "Reddit" -t 30' >> ~/.bashrc

Contribution

Please see the CONTRIBUTING.md

Credits

License

The MIT License (MIT)