8 comments

[ 0.64 ms ] story [ 25.4 ms ] thread
This script is used to "measure the weather" on Hacker news.

Just like in real life we don't simply look at the last temperature at 11:59 and say, "This is how the day was." That would be wrong and inaccurate. We take multiple readings on multiple variables per day to get a more complete story.

That is the idea with this little project. Here we measure the weather on Hacker News across a number of variables. My hope is that over time the collection and publication os this data would prove valuable, or at least interesting to some folks. The variable we capture are:

  - timestamp
  - number of comments
  - "karma score"
  - ranking (the link's position in the list)

Next steps will be to add some simple visualizations using a flask app.
I've read this description three times and I still have no idea what it does.
Have you looked at HN API https://github.com/HackerNews/API for way to extract top-n stories via REST?
I did look at it, but I would have to make subsequent calls to get the data I'm looking for. One call to get top stories and then one call each to get the current status of each story. That would make 151 calls ever two mins vs my 5.
I'd raise a PR with API developers to add fields to the top-N method response.
not a bad idea! I'll do it
(I'll copy my reply here so other users can see it.) Unfortunately the way the API is designed, it only returns IDs and you then have to make a separate request to get details for each of those items. We recognize how limited that is and intend to make a new version of the API. In that version, you'll be able to request a JSON version of any page and get all the info that's on that page. I think this will do what you want, or at least will easily be extendable to do it.
That would be great for anyone who tries to build an API client, whether for reading or analytics such as the OP.