Live data from Hacker News

Hacker News API

blog.ycombinator.com

281–290 of 315 posts

Re: Hacker News API

#281

Oh man you guys, patio11 has generated massive amounts of content: https://hacker-news.firebaseio.com/v0/user/patio11.json?prin... I count 8,483 submissions. I'm sure there's something interesting to be done with all of this data. A word frequency chart? --- Edit: So apparently there's a ruby gem that lets you feed it a body of text and generates pseudo-random phrases based on that text. I present to you the patio11…

Thanks, I had been curious about that number for a while. The last time I checked it was 500k or so. For folks who want to do interesting things with the API but don't want to be abusive to Firebase's servers, I whipped up a quick ruby script to cache a particular user's comments/submissions on disk: https://gist.github.com/patio11/1550cad3a02edd175049 It tries to rate limit itself by putting 200ms of sleep between r…

Interesting - you rate limited your requests, and I multithreaded mine :p (with x10 I downloaded your comments in From https://www.firebase.com/pricing.html it looks like the top plan supports 10k concurrent connections, so I suspect the impact is negligable.

Thanks for being an outrageously good resource and beacon of inspiration! You've unknowingly been one of the most influential role models in my career/life: I just relaunched one of my side projects as SaaS last month and it's succeeded beyond my wildest expectations (already at ~$8k YRR). Hopefully I can follow your trajectory and never have to actually work another day in my life :)

Re: Hacker News API

#282
post #262

Earlier quoted context omitted.

Oh, thanks for the reminder. I fixed it a few days ago and did a staged rollout but forgot to push it to everyone. I've done that so it should update for you soon.

It works now, thanks! One side question: why is your hamburger (icon) a Double-Double ( http://www.in-n-out.com/mobile/double-double.aspx )?

Ha! A) Because I love Double-Doubles. B) Because it's more than 2 year old (before there really was a hamburger icon on Android). It's completely redesigned in the next version, though.

Re: Hacker News API

#283
post #269

The Firebase JavaScript library makes make this impressively straightforward to use. I built a clone using React.js and Firebase's library. Because v0 of the API requires a request for each news story, it's not possible to use Firebase's React mixin yet. https://github.com/ssorallen/hackernews-react

Here's another React version which also does comments (and allows you to fold them - I needed to write a userscript for that before!). It's using react-router to switch between top stories, comments, individual comment and user profile pages. http://insin.github.io/react-hn I've just gone for it with Firebase's React mixin, binding everything as an object, since their devs in this thread don't seem concerned about ra…

Nicely done! Binding every HN story as an object would have been the simplest approach, that makes sense.

Is the source available somewhere?

Re: Hacker News API

#284
post #202

I wrote a stupid simple wrapper and pushed it to PyPI. My excuse is that I needed to learn how to use setuptools today. pip install hackernews-python Usage: >>> from hackernews import HackerNews >>> hn = HackerNews() >>> hn.top_stories() [8422599, 8422087, 8422928, 8422581, 8423825... >>> hn.user('pg') {'delay': 2, 'id': 'pg', 'submitted': [7494555, 7494520, 749411... >>> hn.item(7494555)['title']) Hacker News API >>…

Can't get it to work, e.g., for `hn.top_stories()` I get: Traceback (most recent call last): File " ", line 1, in File "hackernews.py", line 23, in top_stories return r.json() TypeError: 'list' object is not callable Tried in both python 2.7.3 and python 3.2.3 EDIT: You need a relatively new version of requests for this to work. The version packaged with Debian Wheezy is too old. Use pip.

Thanks for the feedback!

Prior to version 1.0.0 response.json() was a property, and was not callable. That's probably what caused your error.

I'll add a minimum version to requirements.txt for the folks that install this package manually.

Re: Hacker News API

#285
post #269

Earlier quoted context omitted.

Here's another React version which also does comments (and allows you to fold them - I needed to write a userscript for that before!). It's using react-router to switch between top stories, comments, individual comment and user profile pages. http://insin.github.io/react-hn I've just gone for it with Firebase's React mixin, binding everything as an object, since their devs in this thread don't seem concerned about ra…

Nicely done! Binding every HN story as an object would have been the simplest approach, that makes sense. Is the source available somewhere?

Original source is here until I set up a proper repo (after modularising and setting up a build process):

https://github.com/insin/insin.github.com/blob/master/react-...

Re: Hacker News API

#286
post #147

Would it be possible to cache the number of comments a story has? Or am I wrong in my understanding that the only way to find the number of comments a story has is to walk the tree of child items and maintain my own count?

+1

Re: Hacker News API

#287

Earlier quoted context omitted.

Thanks, I had been curious about that number for a while. The last time I checked it was 500k or so. For folks who want to do interesting things with the API but don't want to be abusive to Firebase's servers, I whipped up a quick ruby script to cache a particular user's comments/submissions on disk: https://gist.github.com/patio11/1550cad3a02edd175049 It tries to rate limit itself by putting 200ms of sleep between r…

Interesting - you rate limited your requests, and I multithreaded mine :p (with x10 I downloaded your comments in From https://www.firebase.com/pricing.html it looks like the top plan supports 10k concurrent connections, so I suspect the impact is negligable. Thanks for being an outrageously good resource and beacon of inspiration! You've unknowingly been one of the most influential role models in my career/life: I j…

Congratulations on the success. Nothing in business makes me as happy as folks telling me that what I wrote/did/etc helped them out.

Though I don't know if I'd describe my lifestyle as "never having to actually work another day in my life." It feels less like work some days and more like work others. For example, it is 1:30 AM and while I could be snug in my bed I am instead clearing out the AR support inbox. (Poor planning earlier today, but still.)

Re: Hacker News API

#288
post #265

Earlier quoted context omitted.

Would you be willing to beta test my application? It's pretty much finished already and doesn't have any of the issues you listed (in addition to having a, in my opinion, much nicer design), I'd just be looking for some general feedback regarding the discoverability of some features. I could submit a beta today or tomorrow.

I'd love an invite as well, if possible.

Sure, just need your Microsoft account email so I can add you to the beta list.

Re: Hacker News API

#289
I think quality of the v0 API is not so good for the following reasons.

1. Major functions are dropped (best, new, job, ask,...)

2. Useless response schema of the top stories API (should learn from Netflix's internal/public API design)

3. A short transition period

It's very hard to provide same responses to apps.

Re: Hacker News API

#290

Decided to recreate the Hacker News homepage using Ember and the new API. I was really pleased with how easy it was! https://realtimehackernews.firebaseapp.com/

dstaley nice work. Would be nicer still if firebase had SPDY and QUIC lit up. I don't think it would be a problem with Apache already in front of Varnish.

But more importantly, why no favicon? ;)

Post reply on HN