Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. OpenJev(openjev.com ↗)
    98comments
  2. ZCode, the GLM coding agent, silently uploads your Git history(tokenstead.ai ↗)
    15comments
  3. Jemalloc 5.4.0(github.com/jemalloc ↗)
    54comments
  4. Microsoft exec called AI scraping 'the largest theft of labor in human history'(techcrunch.com ↗)
    191comments
  5. The scourge of x86 emulation(fex-emu.com ↗)
    36comments
  6. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  7. Astra for Law(openai.com ↗)
    601comments
  8. Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint(prismml.com ↗)
    143comments
  9. Replacing Pull Requests with Delta(zed.dev ↗)
    16comments
  10. Subnormal floating-point numbers are expensive on Intel processors(lemire.me ↗)
    1comments
  11. Bend – A language that blocks AI mistakes via proof, on CPU and GPU(bend-lang.com ↗)
    238comments
  12. Qwen 3.8 Omni Flash(qwen.ai ↗)
    88comments
  13. Hister: A private search engine for the pages you visit and the files you keep(github.com/asciimoo ↗)
    171comments
  14. Wax motor(wikipedia.org ↗)
    75comments
  15. Warren Buffett Steps Down as Berkshire Chairman, Names Son to Replace Him(nytimes.com ↗)
    14comments
  16. Pre-Greek: The lost language hidden within Ancient Greek(linguisticdiscovery.com ↗)
    43comments
  17. When the fractional part of a float fixes your shader(crocidb.com ↗)
    8comments
  18. Fujitsu launches made-in-Japan next-generation CPU FUJITSU-MONAKA(global.fujitsu ↗)
    236comments
  19. Dr Julius Neubronner's Miniature Pigeon Camera(publicdomainreview.org ↗)
    discuss
  20. How to Write with an LLM(sockpuppet.org ↗)
    128comments
  21. A heap overflow and SSO misconfiguration to compromise OpenAI internal repos(hacktron.ai ↗)
    159comments
  22. Shapelearn Qwen 3.8 27B (13.1 GB VRAM)(byteshape.com ↗)
    17comments
  23. Ask A Monk – A digital wilderness for thoughts with no immediate answer(askamonk.online ↗)
    27comments
  24. Flet 1.0 – Build cross-platform apps in Python(flet.dev ↗)
    67comments
  25. Telstra outage: The night a network decided the year was 2006(netnod.se ↗)
    29comments
  26. Diplodocus, Long Thought Exclusively American, Turns Up in Spain(sci.news ↗)
    45comments
  27. Speeding up gearhash on ARM64(sam.dev ↗)
    discuss
  28. Google illegally retains customer data,and I am taking legal action against them(medium.com/istokovicsgyorgy79 ↗)
    7comments
  29. The most important product decision is what you don't build(liamnugent.me ↗)
    41comments
  30. Why I didn’t sign the Fields medallists’ letter(gowers.wordpress.com ↗)
    374comments

Tell HN: Full Hacker News dataset now available on BigQuery

238 pointsby 11y ago
39 comments
https://bigquery.cloud.google.com/table/fh-bigquery:hackernews.comments

The dataset is up-to-date for October 2015 and uses the official HN API as a data source. (Unfortuntely, this includes the HTML formatting in the comments) Dataset is about 4GB total; since BigQuery allows for 1000GB processing for free each month, it is effectively no cost to analyze.

Felipe Hoffa (who uploaded the dataset) has links to the dataset along with some sample Python code for analysis: https://github.com/fhoffa/notebooks/blob/master/analyzing%20hacker%20news.ipynb

I have a few scripts for downloading all the data manually (https://github.com/minimaxir/get-all-hacker-news-submissions-comments ), but the BigQuery table may be more pragmatic. I can do some more sample queries if requested. (See my BigQuery tutorial for Reddit data: http://minimaxir.com/2015/10/reddit-bigquery/ )

11y agoHN ↗

That will not get you accurate results for HN data analysis since a) those accounts only tweet important links so analysis will be biased b) you can only get 3200 tweets at a time. (This is a Twitter API limitation)

You have to look at both the good and the bad.

11y agoHN ↗

I hear you. Raw unfiltered links always have hidden gems.

One thing though: Greptweet has an archive somewhere with a huge trove of tweets that users of the service have searched for, and were thus logged and kept. (Some even go over the 3200 limit). It's a massive Tarball, so set aside time to download it and parse out boring/noisy links.

A lot of HN links are tech-press posts which consist of hearsay and merely proxy the thoughts of others. The recent changes in HN with regards to more academia-style posts is refreshing.

11y agoHN ↗

What is the "comment_ranking" data you mention in the notebook?

11y agoHN ↗

Hacker News chose to hide comment scores some time ago, but I still wanted to find a way to rank comments. The good news is that the API gives you a "kids" column that ranks comments in the order they should be displayed - that's how I can find what's the top comment for each post (as shown in the linked notebook).

11y agoHN ↗

I guess it incorporates gravity - it's whichever way Hacker News tells its clients to rank the comments by.

11y agoHN ↗

There are items in there that are deleted/[dead] on HN (and not very recent). How come?

11y agoHN ↗

You can see dead things on HN if you turn on "showdead" in your account settings.

11y agoHN ↗

Great stuff! Looks like the whole dataset was imported 2 days back. If you can stream it daily, I can use table decorator and avoid processing all the records.

11y agoHN ↗

This is really cool; thanks! Not exactly sure what I'll do with it (honestly probably nothing) but it's sure cool especially since I didn't know about BigQuery prior.

11y agoHN ↗

Why wouldn't it be? All the data provided by the HN API is public.

11y agoHN ↗

It would be a godsend to the #hnwatch crowd looking for sentences to take out of context.

11y agoHN ↗

Yes, when you submit a comment to HN you intend for it to be published on the HN site. However, using comments for text mining purposes is a different thing and in principle consent is required to do that. The default case is that user submitted content remains copyrighted by the author, with an implied consent for the site to publish the material on the site. There can be an explicit license such as with Wikipedia or StackOverflow; in that case text mining may be explicitly allowed.

11y agoHN ↗

Except email, there is nothing private on HN to raise privacy issue. Public internet is written in ink.

11y agoHN ↗

Perhaps not in the content. But I'm not so sure there might not be actual legal issues (in jurisdiction that have privacy/data protection laws) with regards to stuff like being able to see patterns in login-times (based on post meta data), and similar. It's tenuous -- but just because things are a) on-line in the form of the main hn site, and b) accessible through the api, doesn't automatically mean that giving raw access to the data doesn't carry with it implications for whether or not the data should be considered personal/(more)sensitive.

I'm assuming this data set offers something the API doesn't (that's the point of uploading it, right? Other than just being an easy way for others to "back up" the hn data) -- and that can very well mean there are privacy/personal data implications.

I'm mostly stating this because of the principle, not because I think it's anything wrong with this concrete upload of hn data (and wrong != legal/illegal anyway).

As an example, at least in Norway, while you may have two separate databases that are linked to people, such as a database of cars passing through toll booths, and credit card charges from a large bar/restaurant chain -- it would generally be illegal to link the two.

11y agoHN ↗

It's sort of a moot point. It's not especially difficult to scrape HN and compile a dataset like this for yourself.

11y agoHN ↗

I don't see how difficulty has any bearing on privacy or copyright issues.

11y agoHN ↗

It's a little like saying it's easy enough to make your own wine and sell it to minors. It is, but that doesn't make it legal.

11y agoHN ↗

No it's like that wine is available for everyone to buy anyway (via HTTP) and people are arguing that perhaps the bottled version (via non-HTTP protocol) should be age limited while keeping non-bottled version as is.

11y agoHN ↗

Very cool, thanks! Looking forward to playing around with this.

FYI, you named a column a reserved sql keyword ('by'). For future reference, and for others reading this: this is bad database design and makes it harder to use the table. You can get around this by wrapping the column name in brackets, like:

select ... where [by] = ...

11y agoHN ↗

I didn't name the column "by", I just gave the field the name that the API uses for it.

And to make everyone's lives easier (including mine), I copied the [by] column to an [author] column, so you can do a

select ... where author = ...

instead :)

11y agoHN ↗

Oh, first I thought there is some difference and did this:

  SELECT * FROM [fh-bigquery:hackernews.stories] WHERE [by] != author
11y agoHN ↗

Huge fan of BQ, its the best product Google Cloud has that AWS doesn't. Excited for its future.

11y agoHN ↗

This makes a really nice introduction to BigQuery (which is to say: BigQuery is nicely discoverable, given an easy-to-understand dataset).

Is there a good way to find the story to which a comment belongs? This dataset raises the issue of recursive query (e.g. "with recursive" in SQLite or PostgreSQL, or "connect by" in Oracle). The only approach I see in BigQuery is specifying a fixed level with something scary like:

  SELECT p0.text, s.id, s.title
  FROM
    [fh-bigquery:hackernews.comments] p0
  JOIN EACH [fh-bigquery:hackernews.comments] p1 ON p1.id=p0.parent
  JOIN EACH [fh-bigquery:hackernews.comments] p2 ON p2.id=p1.parent
  JOIN EACH [fh-bigquery:hackernews.comments] p3 ON p3.id=p2.parent
  JOIN EACH [fh-bigquery:hackernews.comments] p4 ON p4.id=p3.parent
  JOIN EACH [fh-bigquery:hackernews.stories] s ON s.id=p4.parent
  WHERE
    REGEXP_MATCH(p0.text, '(?i)bigquery')
  ORDER BY
    p0.time DESC

For this particular data set: linking each comment to its story might be a good denormalization.

11y agoHN ↗

You are right - I'll prepare a new release with that data.

My oversight, sorry! :)

11y agoHN ↗

Not an oversight — just a different use case for the data! And I wasn't sure if BigQuery had a generic approach here, but it looks like not.

11y agoHN ↗

Btw, I really like your query.

I modified it to get the story for up to 7 levels of recursion:

  SELECT p0.id, s.id, s.title, level
  FROM (
    SELECT p0.id, p0.parent, p2.id, p3.id, p4.id, COALESCE(p7.parent, p6.parent, p5.parent, p4.parent, p3.parent, p2.parent, p1.parent, p0.parent) story_id,
           GREATEST(IF(p7.parent IS null, -1, 7), IF(p6.parent IS null, -1, 6), IF(p5.parent IS null, -1, 5), IF(p4.parent IS null, -1, 4), IF(p3.parent IS null, -1, 3),
                    IF(p2.parent IS null, -1, 2), IF(p1.parent IS null, -1, 1), 0) level
    FROM    [fh-bigquery:hackernews.comments] p0
    LEFT JOIN EACH [fh-bigquery:hackernews.comments] p1 ON p1.id=p0.parent
    LEFT JOIN EACH [fh-bigquery:hackernews.comments] p2 ON p2.id=p1.parent
    LEFT JOIN EACH [fh-bigquery:hackernews.comments] p3 ON p3.id=p2.parent
    LEFT JOIN EACH [fh-bigquery:hackernews.comments] p4 ON p4.id=p3.parent
    LEFT JOIN EACH [fh-bigquery:hackernews.comments] p5 ON p5.id=p4.parent
    LEFT JOIN EACH [fh-bigquery:hackernews.comments] p6 ON p6.id=p5.parent
    LEFT JOIN EACH [fh-bigquery:hackernews.comments] p7 ON p7.id=p6.parent
    HAVING level=0
    LIMIT 100
  ) a
  LEFT JOIN EACH [fh-bigquery:hackernews.stories] s
  ON s.id=a.story_id

(having so many left joins consumes a lot of resources, so to run it massively I would look for a different strategy)

11y agoHN ↗

Many thanks! Could you put up a magnet link so we can download the data ourselves? It would also be useful to have the submission id as a field in the comment table.

11y agoHN ↗

Thank you for this, I think it's great!

11y agoHN ↗

Cool.

I'd be interested to see a list of people who submit a lot. I submit too much - about one submission per day - and I'm curious what percentile that puts me in.