Live data from Hacker News

Hacker News API

blog.ycombinator.com

51–60 of 315 posts

Re: Hacker News API

#51

Earlier quoted context omitted.

UNIX time is actually much easier to parse and more accurate. Almost all platforms (even Windows[0]) have a way to convert a UNIX time into a culture specific local time. What you're asking for is a string you have to parse. That's a lot more work and there is a lot more that can go wrong. [0] https://stackoverflow.com/questions/249760/how-to-convert-un...

Um, how about, no? var time = new Date(" ") // in Javascript time = DateTime.iso8601(" ") # in Ruby Aaaand it's human readable! Aaaaand it works before the Unix epoch! EDIT: Changed DateTime.parse to DateTime.iso8601, to be even more retentive. Look, parent claimed that parsing ISO strings is hard (it's not, especially if you're consuming a web api on a modern web language ) and that it was more readable (which is so…

That's two programming languages. Not all languages have a nice ISO-8601 parser built-in.

Human-readable is a slight advantage, agreed.

Re: Hacker News API

#52

This... is cool, but also kinda sucks for me. I've invested dozens of hours into writing an extremely complicated scraper for my Android version of HN. https://play.google.com/store/apps/details?id=com.airlocksof... The newest version (still under development, probably a month or two from release) adds support for displaying polls, linking to subthreads, and full write support (voting, commenting, submitting, etc). I…

Yes. While with HTTP pipelining you can request them all over a single TCP connection using a single SSL session, you will need to make an HTTP request for each item you want.

If you're on a supported platform, the Firebase SDKs handle all this efficiently and can even provide real-time change notifications.

Re: Hacker News API

#53

Why do you have all the times in Unix time instead of ISO-8601 UTC? EDIT: Also, the "about" value in the users api appears to be truncated. Compare... https://hacker-news.firebaseio.com/v0/user/angersock# ...with... https://news.ycombinator.com/user?id=angersock EDIT2: Note that the JSON is correct, but the preview in the firebase API seems to be broken. EDIT3: No issue tracker on the Github? Laaaame.

UNIX time is actually much easier to parse and more accurate. Almost all platforms (even Windows[0]) have a way to convert a UNIX time into a culture specific local time. What you're asking for is a string you have to parse. That's a lot more work and there is a lot more that can go wrong. [0] https://stackoverflow.com/questions/249760/how-to-convert-un...

How is it more accurate? ISO-8601 allows for leap seconds, it uses the same second counting frequency as the Unix timestamp, it can represent dates before 1970 and after 2038 (64-bit Unix timestamps will also.) and it's an international standard.

There are very few good reasons to choose a Unix timestamp to represent a date when compared with ISO-8601.

Re: Hacker News API

#54
post #50

I've been working on a Hacker News client for Windows Phone over the past several weeks and am very close to an initial release, so I feel somewhat ambivalent about this. On the one hand, of course it's great that HN is finally getting a proper API and also modernizing its markup (which is a mess even if you ignore all the tables – for example, the first paragraph in a comment usually isn't wrapped in tags), but on t…

> (which is a mess even if you ignore all the tables – for example, the first paragraph in a comment usually isn't wrapped in

tags)

Oh, that's in the actual API.

https://hacker-news.firebaseio.com/v0/item/8422922.json?prin...

I strongly hope they add a plain-text field for returned comments.

Re: Hacker News API

#55
post #47

I always thought HN was more of a one man job. I didn't realize there is an entire team working on it (full time?). Honestly there doesn't seem to be much to work on here. It's a simple site that rarely changes (at least on the front end).

'Simple site' that gets probably tens of thousand if not hundreds of throusand unique visitors a day.

Re: Hacker News API

#56
post #47

I always thought HN was more of a one man job. I didn't realize there is an entire team working on it (full time?). Honestly there doesn't seem to be much to work on here. It's a simple site that rarely changes (at least on the front end).

I believe the whole idea of having multiple people working on it permanently was only introduced six months to a year ago(?) And it seems like big changes are happening underneath us, mostly in terms of story quality: https://twitter.com/sama/status/519240112907894784

Re: Hacker News API

#57
post #52

This... is cool, but also kinda sucks for me. I've invested dozens of hours into writing an extremely complicated scraper for my Android version of HN. https://play.google.com/store/apps/details?id=com.airlocksof... The newest version (still under development, probably a month or two from release) adds support for displaying polls, linking to subthreads, and full write support (voting, commenting, submitting, etc). I…

Yes. While with HTTP pipelining you can request them all over a single TCP connection using a single SSL session, you will need to make an HTTP request for each item you want. If you're on a supported platform, the Firebase SDKs handle all this efficiently and can even provide real-time change notifications.

[Firebase Employee]

If you use the SDKs, we handle the connection and all of the data is sent over a reused full duplex socket rather than individual requests. https://www.firebase.com/docs/android/, https://www.firebase.com/docs/ios/, https://www.firebase.com/docs/web/

Re: Hacker News API

#58

How does this differ from the Algolia HN API in terms of data access? ( https://hn.algolia.com/api ) I was able to download all HN data recently with ease using that endpoint. Authentication? EDIT: After looking at the documentation there are two new aspects of the Firebase API not in the Algolia API: 1) Ability to see deleted/dead stories. 2) Endpoint for user data. Question to kogir/dang: Has the "delay" field (Del…

[deleted]

Re: Hacker News API

#59

This... is cool, but also kinda sucks for me. I've invested dozens of hours into writing an extremely complicated scraper for my Android version of HN. https://play.google.com/store/apps/details?id=com.airlocksof... The newest version (still under development, probably a month or two from release) adds support for displaying polls, linking to subthreads, and full write support (voting, commenting, submitting, etc). I…

[Firebase Dev Advocate] @airlocksoftware - Yes, you should make separate requests for each story. You can attach a listener to the topstories node (https://www.firebase.com/docs/web/guide/retrieving-data.html...) and when that’s triggered, you can make a request for the data on each story. Using the Firebase SDK, each request will get made using the same connection. I'd recommend using our SDK instead of the REST API so you don't have to worry about managing your own connections and retries.
Post reply on HN