Crates.io | hn-cli |
lib.rs | hn-cli |
version | 0.3.0 |
source | src |
created_at | 2021-11-24 22:01:25.997541 |
updated_at | 2021-12-03 02:59:11.845136 |
description | Another HackerNews command-line client. |
homepage | https://github.com/scastiel/hn |
repository | https://github.com/scastiel/hn |
max_upload_size | |
id | 487331 |
size | 2,786,405 |
hn-cli
, a command-line tool to read HackerNewsYou’ll need first to install the Rust toolchain, then: cargo install hn-cli
List stories (add -p3
or --page 3
to display the third page):
hn
or hn top
or hn t
hn new
or hn n
hn best
or hn b
hn show
or hn s
hn ask
or hn a
hn job
or hn j
After listing stories, note the index of the story you are interested in (let’s suppose it is 5
), then:
hn details 5
or hn d 5
hn open 5
or hn o 5
You can also display the details about a user with hn user the_user_name
or hn u the_user
.
To login, use hn login
or hn l
. The auth token will be persisted to be used in the next commands. Note that to perform write operations (such as upvoting a story), you will need to reload the list of the stories using the commands listed above, such as hn top
.
To logout and remove the persisted auth token, use the command hn logout
.
Note: information is obtained by scraping the HackerNews website. The reason this crate does not use the official API is that it does not provide a convenient way to get all the comments for a given story, and only allows read operations.
MIT, see LICENSE.