Live data from Hacker News

Show HN: 22 GB of Hacker News in SQLite

hackerbook.dosaygo.com

131–140 of 229 posts

Re: Show HN: 22 GB of Hacker News in SQLite

#131
post #9

The query tab looks quite complex with all these content shards: https://hackerbook.dosaygo.com/?view=query I have a much simpler database: https://play.clickhouse.com/play?user=play#U0VMRUNUIHRpbWUsI...

Does your database also runs offline/locally in the browser? Seems to be the reason for the large number of shards.

You can run it locally, but it is a client-server architecture, which means that something has to run behind the browser.

Re: Show HN: 22 GB of Hacker News in SQLite

#132
post #23

Earlier quoted context omitted.

No, I just went straight to sqlite. What is duckdb?

One interesting feature of DuckDB is that it can run queries against HTTP ranges of a static file hosted via HTTPS, and there's an official WebAssembly build of it that can do that same trick. So you can dump e.g. all of Hacker News in a single multi-GB Parquet file somewhere and build a client-side JavaScript application that can run queries against that without having to fetch the whole thing. You can run searches…

In that case, then using duckdb might be even more performant than using what we’re doing here.

It would be an interesting experiment to add the duckdb hackend

Re: Show HN: 22 GB of Hacker News in SQLite

#133
post #71

Looks like the repo was taken down (404). That's too bad, I'd like to see the inner-working with a subset of data, even with placeholders for the posts and comments.

But why would they take it down?

Sorry i just forgot to set it to public! It’s there now

Re: Show HN: 22 GB of Hacker News in SQLite

#134

Site does not load on Firefox console error says 'Uncaught (in promise) TypeError: can't access property "wasm", sqlite3 is null' Guess its common knowledge that SharedArrayBuffer (SQLite wasm) does not work with FF due to Cross-Origin Attacks (i just found out ;). Once the initial chunk of data loads the rest load almost instantly on Chrome. Can you please fix the GitHub link (current 404) would like to peak at the…

Damn. Will try to fix for FF.

edit: I just tested with FF latest, seems to be working.

Re: Show HN: 22 GB of Hacker News in SQLite

#135
post #24

What a reminder on how text is so much more efficient than video, its crazy! Could you imagine the same amount of knowledge (or dribble) but in video form? I wonder how large that would be.

Right? 20 years, probably 10s millions of human hours of interactions, and it’s only as much as a couple DVDs.

Re: Show HN: 22 GB of Hacker News in SQLite

#136

It's really a shame that comment scores are hidden forever. Would the admins consider publishing them after stories are old enough that voting is closed? It would be great to have them for archives and search indices and projects like this.

Fear not. I have a collaborative project designed to address this.

Re: Show HN: 22 GB of Hacker News in SQLite

#137

Is there a public dump of the data anywhere that this is based upon, or have they scraped it themselves? Such as DB might be entertaining to play with, and the threadedness of comments would be useful for beginners to practise efficient recursive queries (more so than the StackExchange dumps, for instance).

Yes, you can see the download HN bash script in the repository now that simply extract the data to your local machine from BigQuery and saves it as a series of gzip JSON files

Re: Show HN: 22 GB of Hacker News in SQLite

#138
post #56

Apparently the comment counts are only the top-level comments? It would be nice for the thread pages to show a comment count.

Yes, because comments in a thread can span shards. It’s just a bit too heavy to add comment counts of an entire thread. So I give a low bound ha ha

Re: Show HN: 22 GB of Hacker News in SQLite

#139
post #22

Don't miss how this works. It's not a server-side application - this code runs entirely in your browser using SQLite compiled to WASM, but rather than fetching a full 22GB database it instead uses a clever hack that retrieves just "shards" of the SQLite database needed for the page you are viewing. I watched it in the browser network panel and saw it fetch: https://hackerbook.dosaygo.com/static-shards/shard_1636.sqli…

Is there anything more production grade built around the same idea of HTTP range requests like that sqlite thing? This has so much potential

Parquet/iceberg

Re: Show HN: 22 GB of Hacker News in SQLite

#140
post #18

Wonder if you could turn this into a .zim file for offline browsing with an offline browser like Kiwix, etc. [0] I've been taking frequent "offline-only-day" breaks to consolidate whatever I've been learning, and Kiwix has been a great tool for reference (offline Wikipedia, StackOverflow and whatnot). [0] https://kiwix.org/en/the-new-kiwix-library-is-available/

Oh that's a cool idea. If you want to take a crack at writing the script, the repo is open!
Post reply on HN