4 ms·
Show HN: CLI for Hacker News
Hi HN! I've built hnterminal, a pip package that lets you browse, upvote, and comment on HN from terminal:
$ pip install hnterminal
$ hnterminal
hnterminal is an interactive REPL environment with commands like "get_front_page", "get_tree", "upvote", "reply_to", etc, each of which supports rich arguments and comes with full help documentation.
On the read side, hnterminal uses the HN API to construct front page and comment trees. On the write side, it reads the webpage and constructs an API response from parsed information. Unfortunately, a write API does not exist for HN (that I know of). Login is accomplished with a login cookie that is only stored in memory as it runs. You don't need to login to browse HN, its only for upvotes and commenting.
- Aperocky 4y agoCheck out the readme for full demo: https://github.com/Aperocky/hnterminal/blob/master/README.md https://github.com/Aperocky/hnterminal/blob/master/README.md This comment is edited in vim and sent from hnterminal CLI.
- pratio 4y agoreplying from HN terminal as well. I love this. :)
- tough 4y agoIf it showed full links those would be clickable with cmd+click on fp w iterm or such
- Aperocky 4y agoyou can use get_link [POINTER] to get the full HN link on any story/comment. For story links, they are listed whenever `get_story` or `get_tree` is called.
- Aperocky 4y agoFor example: hnterminal > gt 4 POINTER -1: PARENT STORY Show HN: CLI for Hacker News 2023-03-26 12:23:28 AUTHOR: Aperocky FULL URL: https://github.com/Aperocky/hnterminal