3 ms·
The Antarctica Internet one reminded me of http://hn.zip http://hn.zip, which caches as much as it can for spotty connections.
by fragmede 2y ago
The Antarctica Internet one reminded me of http://hn.zip http://hn.zip, which caches as much as it can for spotty connections.
- codetrotter 2y agoThe https://www.hn.zip/ https://www.hn.zip/ website links to a GitHub repo https://github.com/lukeschaefer/hn.zip https://github.com/lukeschaefer/hn.zip but that repo link currently gives a 404. Maybe owner of the site forgot to make the repo public or something. Can’t find any other repo on their profile that appears to be for that project either.
- lukeschaefer 2y agoAh that's on me, it's a private repo because my code is embarrassing. But behind the scenes here's how it works: - 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.
- codetrotter 2y agoNeat! Thanks for the details :)
- fragmede 2y agofwiw, the API (described here https://github.com/HackerNews/API https://github.com/HackerNews/API) will just give you json, eg https://hacker-news.firebaseio.com/v0/item/40564831.json?print=pretty https://hacker-news.firebaseio.com/v0/item/40564831.json?pri...
- andai 2y ago>[from profile:] Recently quit my job, now I work on anything that holds my interest (until I run out of money) 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.
- inslee1 2y agoGreat link! Might have found a bug in Chrome with it though :) 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.
- dionian 2y agoThis is pretty amazing on my fast connection. makes you realize how slow things actually are when you use something like this
- lukeschaefer 2y agoAuthor of hn.zip here - thanks so much for the shout out! I never really publicize it and never 100% finished it, but I'm so glad people are using it! It's basically how I browse HN on my phone and once it reached 90% good enough I stopped working on it haha.
- heyoni 2y agoCan you do this with every website in the world?? I’m kidding of course but man, it pains me to browse the web as it is today knowing that things could be “this good”. I just tried it and it was an amazing experience.