What I really want is a reader view on the terminal -- something that cuts out all layout, formatting and images and shows me the raw article text in a fixed with font. Ditto for comments. I've already tried the "hn" [1] command line tool, but it doesn't strip out navigation menus, heads and footers from articles. It's also a bit slow.
> something that cuts out all layout, formatting and images and shows me the raw article text in a fixed with font.
FYI, I have implemented a reader view for `hackernews_tui v0.6.0` [0] which seems to satisfy most of the conditions above. Judging from my experience, this reader view works quite well and can cover many use cases.
I just played around with newspaper3k today, and it works really well out of the box.
I plan to add support for article view reader mode with newspaper3k integration. My current approach is to create a child process with `std::Process:Command` then run a python script. Doesn't seem to be the best approach, but I guess it's the easiest one.
That's why I like RSS. Strip out everything but the content and use whatever UI I prefer. Newsbeuter is a good RSS readers for the terminal. Several services and open source programs like TT-RSS allow you to get the full-text instead of just a blurb. And for sites without RSS feeds, there are services that make it easy to scrape HTML pages and output an RSS feed.
I just realize that you are the author of https://github.com/ggerganov/hnterm. I just came across with it recently while finding some HackerNews apps on GitHub. If I understand correctly, `hnterm` seems to use the official Hacker news API for rendering. I found it quite hard to use compared to the HN Algolia APIs. Do you have any suggestions on how to utilize the official APIs better?
Actually, I wasn't even aware that there is HN Algolia API :-)
From quick look, it seems the Algolia API offers a Search API which I don't think you can implement using the official API.
However, the official API seems to have a big advantage that it tells you which were the items that were updated recently - i.e. scores, comments, stories, etc. Using this you can implement real-time updates of the screen by fetching only the modified items. I believe using the Algolia API you would need to fetch everything over and over.
But other than that, the two APIs are similar. I guess the official one is more low-level than the other. The main difference is that you need to fetch the children one-by-one while with Algolia you seem to get this in one call.
This is an amazing looking TUI, and I can tell you've put a lot of work and thought into this. Amazing job! You're making me want to install/learn Rust so I can try this out and/or contribute to this (if contributors are allowed, that is). :)
Also, what a small world! I've been building a similar, Python-based application [0] for reading HN for the last few months, but it's nowhere near as nice-looking or complex as yours (and currently only an MVP that uses less with the -R flag lol). I actually grabbed the data based on parsing raw HTML, but using Algolia is something I hadn't considered.
Fantastic! Here are three features that I would love to see:
1. collapsable threads, ideally with three different shortcuts: (i) collapse daughters of current comment, (ii) collapse mother of current comment - this is very useful when on the Nth comment far away below the mother comment, so no need to scroll up, but can continue reading the sister of mother's comment, (iii) collapse entire thread.
2. A story view for the /active section. I think there is no official API for it, but I find it to be the most useful entrypoint into HN at the beginning of the day, to catch up.
3. Semi-offtopic dreamland: a version adapted to (a terminal in) the remarkable and related tablets :)
> 1. collapsable threads, ideally with three different shortcuts: (i) collapse daughters of current comment, (ii) collapse mother of current comment - this is very useful when on the Nth comment far away below the mother comment, so no need to scroll up, but can continue reading the sister of mother's comment, (iii) collapse entire thread.
Please correct me if I misunderstand your request. I guess what you want is navigating between sibling comments right? It seems that most of the use cases you mention above can be done with a combination of `l` (move to the next sibling) and `h` (move the previous sibling) commands.
> 2. A story view for the /active section. I think there is no official API for it, but I find it to be the most useful entrypoint into HN at the beginning of the day, to catch up.
I don't really get this feature. Can you elaborate more?
> 3. Semi-offtopic dreamland: a version adapted to (a terminal in) the remarkable and related tablets :)
Yeah, I also would love to achieve this, but supporting tablets seems to be quite painful experience :<.
> I guess what you want is navigating between sibling comments right?
It's actually more than that: when there are lots of sub-comments, it helps to see the immediate "mother" of the comment node you're reading. Imagine a comment that has two replies, and the first reply has dozens and dozens of sub-replies and sub-sub-replies, which typically veer into all sorts of adjacent issues. By the time I'm done with the 1st reply and its dozens and dozens of sub-replies, it is often unclear what the initial comment (or even topic) was. It is then very helpful to be able to glance back up to the initial comment across the now-collapsed first reply and its dozens and dozens of sub-replies, before reading reply #2. Simply navigating to reply #2 doesn't give you that.
> don't really get this feature. Can you elaborate more?
I mean this page of the HN site: https://news.ycombinator.com/active . It has the currently actively discussed stories, and is a great way to catch up after not reading HN for a day or two. A kind of intermediate step between best ( https://news.ycombinator.com/best ) and the homepage.
[Edit: the 'active' page apparently has an RSS feed here, in case you would be inclined to add it: https://hnrss.org/active ]
> It's actually more than that: when there are lots of sub-comments, it helps to see the immediate "mother" of the comment node you're reading. Imagine a comment that has two replies, and the first reply has dozens and dozens of sub-replies and sub-sub-replies, which typically veer into all sorts of adjacent issues. By the time I'm done with the 1st reply and its dozens and dozens of sub-replies, it is often unclear what the initial comment (or even topic) was. It is then very helpful to be able to glance back up to the initial comment across the now-collapsed first reply and its dozens and dozens of sub-replies, before reading reply #2. Simply navigating to reply #2 doesn't give you that.
I think I get what you mean. Instead of adding 3 different collapse commands, WDYT about adding one command to collapse the current comment and one command to move up to the parent comment?
> I mean this page of the HN site: https://news.ycombinator.com/active . It has the currently actively discussed stories, and is a great way to catch up after not reading HN for a day or two. A kind of intermediate step between best ( https://news.ycombinator.com/best ) and the homepage.
Interesting, I don't know `/best` and `/active` exist. `/best` seems to be a list of stories (up to past 4 days) sorted by `points`.
`/active`, on the other hand, and `/news` as well are quite weird. I don't really know the algorithm behind the order of sorting submissions in those.
In the meantime, I guess open the `Story View - All stories` with `sort_by=popularity` and `time_range=past 24 hours` might do the job.
If I understand correctly, Algolia front-page API[0] only allows you to get at most 34 stories (either with `sort_by` points or submitted date).
Hacker News official APIs[1], on the other hands, use a specific algorithm to determine the ranking of submissions and allow you to get at most 500 stories.
Yeah, I was thinking the same thing. The main reason I didn't add `?` in the first place because I want users to be able to open the help menu while typing in the Search View.
update: add `?` as a hotkey to open the help dialog in the new version `v0.5.1`. It seems that many feel more comfortable using `?` than `<ctrl-h>/<alt-h>` as the default hotkey.
[1] https://github.com/donnemartin/haxor-news