A command line tool for Hacker News、 Product Hunt、 GitHub Trending 、Reddit and V2EX feeds.
# install
> npm install -g hacker-feeds-cli
# command option
> hfeeds help
# hf for short
> hf news
# JSON output (for automation/chat paste)
> hf --json github -s daily -l javascript
# config cli
> hf config
# optional: set Product Hunt token
> hf config --ph-token <token>
# optional: use env var instead
> export HF_PRODUCTHUNT_TOKEN=<token>npm test
npm run smoke
npm run smoke:liveUse --json before any sub command:
hf --json github -s daily -l javascript
hf --json news -t 5
hf --json reddit -t popular -s topTo send in chat, paste output inside a fenced block:
{ "source": "github", "items": [] }Because most of the web servers are located abroad, please make sure your network can access the above website properly. You can try pinging the following domains.
ping github.com
ping www.v2ex.com
ping hacker-news.firebaseio.com
ping api.producthunt.com
ping www.reddit.com| Resource | Sub Command | Parameters | Screenshot |
|---|---|---|---|
| GitHub | github |
-l, --lang-s, --since |
![]() |
| Product Hunt | product |
-c, --count-p, --past |
![]() |
| Hacker News | news |
-t --top |
![]() |
reddit |
-t --topic-s --sort |
![]() |
|
| V2EX | v2ex |
-n --node |
![]() |
The Product Hunt feed requires a free API token (the other four feeds work without any key).
- Visit api.producthunt.com/v2/oauth/applications
- Sign in and click Add an Application
- Set any name and
https://localhostas the redirect URI - Open the app and generate a Developer Token
Then configure the CLI:
# Option A: environment variable (add to .bashrc / .zshrc to persist)
export HF_PRODUCTHUNT_TOKEN="your-token"
# Option B: CLI config (saved to ~/.hacker-feeds-cli/config.json)
hf config --ph-token your-tokenVerify it works:
hf product -c 3
# or in JSON mode
hf --json product -c 3Input sub-command config to config cli language.
> hf config
? Please select a language(Default EN): (Use arrow keys)
EN(English)
❯ ZH(简体中文)- i18n support
- Accept resouce param
- Hyper link support
- Support Translate
- Add more resource






