HN-text: an easy-to-use, text-first Hacker News terminal client
github.com
github.com
HN was one of the only sites that was reasonably pleasant to use during that time. Still, I found it more fun and faster to surf via a VPS. So the VPS itself would load and render the page, and only send me the bytes over Mosh (a more efficient SSH protocol).
I tried a few terminal based browsers using this setup. The one that worked best for HN (especially comment indentation!) was w3m.
Here's the current thread in w3m: https://files.catbox.moe/zuabb4.png
I did have fast mobile data but it was expensive and limited. I watched a lot of videos on YouTube and one day realized that almost everything I watched was actually just lectures or discussions. So I could just stream the audio and save 80% of the bandwidth.
I set up a little PHP script* that took a YouTube URL and ran `youtube-dl -g f bestaudio` to give you the URL of an audio-only stream. (Directly from YouTube's servers!)
I could then just load it directly in my browser, or download it for later. (I think I should have used `worstaudio` instead.)
* That little utility page is not up anymore, but others found it very useful so I should probably make another one...
Another benefit of this is to battery life (decoding video is expensive) and being able to turn off the screen (a feature that Google banned from the app store, years before making their own (paid) version available...) Later I learned about f-droid and newpipe... good times :)
- I wrote my own scraper for HN for reasons I no longer remember
- Scraper is called every 30 seconds by an Apps Script timer on a Google Sheet (to be dirt cheap, Vercel doesn't have free cron jobs).
- Caches the front page, plus ten comments per post into a single Firestore document (to save money on reads vs 20 reads per load)
- Home page loads via SSR with Nuxt.
- Post pages will load the rest of the comments from a separate doc for each post
- the other comments load instantly on navigation if on a halfway decent connection - but if not, you still get to see the first 10 comments to get an idea of the discussion while you wait.
- Added some Workbox stuff to get it offline-first.
- Added an IndexDB wrapper around Firestore for more control over cache behavior I think.
- It's worked now for over a year with no oversight needed and not costing a penny!
Then I got distracted because I wanted to rebuild it from scratch to not use Nuxt and never completed that rewrite. Been a while since I've worked on it, had no idea other people even knew it existed! There's definitely some bugs (I think CSS gets broken on deeply nested comments) but it worked enough for my uses so I moved on.
I did the same thing... lots of fun, but the "run out of money" part is rough! I resorted to freelancing, and now I'm going back to university.
I was curious to see more about the internals so I opened up Chrome Devtools and as soon as I clicked on the "Application" tab, it crashes Chrome and did it every time.
I just tried it and it was an amazing experience.
(I think I was able to connect to that with another phone and set up a wifi hotspot for all my devices... but it's been a while!)
This seems contradictory :)
However, I realized that my entire motivation for working offline was that it eliminates distraction. So it would defeat the purpose!
However I'd still much rather be distracted on Wikipedia (or even HN) than other sites (esp. those with primarily images, gifs or video).
I might need to segment it into "tiers", and have more fun parts come "online" as the day progresses...
I started with Benthos to pull in, but since the recent license changes[1] I am rethinking that :(
If you would like to collaborate feel free to shoot me an email!
[0] https://nats.io/
Hope you call it the Innernette :)
https://github.com/donnemartin/haxor-news
But the docker image seemed to dissapear from docker hub so I stopped using it.
PS – thanks for the reminder of this one, was searching to post the exact same comment….
(So for now, yes, press q to quit and run it again)
Hope you don't mind a few additional suggestions/feature requests!
- Single key scroll up/down a page of text (can work around it on my laptop keyboard with fn-down but would prefer not to have to use two hands).
- Maybe customizable key bindings? (i.e, I'm used to hitting space to scroll down a page of text, and don't need to open the story in a browser so often)
- Key binding to toggle "best", or even better, filters to view only the top N stories (I use this[1] site a lot for that).
But yeah keymaps should become configurable eventually.
Or you could just use the terminal browser Lynx, that will display all sites as text-only.
The topic listings work just fine though. Although if I were using Lynx just for the headlines, I might start at https://brutalist.report/ instead of hacker news.
Lynx Style Sheets (LSS) don't really cover that kind of scenario from what I remember[1] - they're more "apply this ncurses/slang-style to this element".[2]
[1] I wrote the original code but I am old and increasingly senile.
[2] I've not really been involved for ~20 years but unless the internal "renderer" has been radically overhauled, supporting anything like "real" CSS isn't really doable.
[0]: https://www.brow.sh/
> Trojan:Win32/Sabsik.FL.A!ml
> Details: This program is dangerous and executes commands from an attacker.
Maybe due to UPX?
Same language and libraries
Just don't understand why web scrapping, wasn't there an API?
By the way, my one and only wish for HN maintainers is to have a dark mode - please...
https://news.ycombinator.com/item?id=40351227 with 8 comments links to last year's discussion with 90 comments:
Great work. Would love to have the options of following someone and getting a feed of their comments/or stories
I took a quick look at your website, and your photography looks really beautiful. Are you based in Copenhagen?
⌞ app
⌞ cli.go <- actual package main
⌞ internal // (or pkg, or pkg/internal)
⌞ parser
⌞ parser.go
⌞ parser_test.go
⌞ ui
...etcdoes your client let us read and write full unicode?
test string: ;