4 ms·
Does the Algolia hackernews api ( the specific API this client uses ) still require you to query in a tree like fashion, every comment item id if you want an en
by Naac 5y ago
Does the Algolia hackernews api ( the specific API this client uses ) still require you to query in a tree like fashion, every comment item id if you want an entire page of comments?
Its extremely inefficient, to the point where I have a better time curling the HN web page and piping it through python beautifulsoup
Regarding a native app vs the using the HN website. The HN website I think is pretty ideal for the type of content its displaying, a native app doesn't give you much over having a HN tab open. I guess only if you want to read HN but not have a web browser open? But how often does that happen?
The only benefit I see from a native app ( and why I use one on Android ) is the ability to save articles and comments for offline reading, say, when I get on a plane.
- Karrot_Kream 5y ago> Does the Algolia hackernews api ( the specific API this client uses ) still require you to query in a tree like fashion, every comment item id if you want an entire page of comments? > Its extremely inefficient, to the point where I have a better time curling the HN web page and piping it through python beautifulsoup Yes it still does and yeah it's ridiculously inefficient. I have a couple tools I've written atop the HN API and all of them are forced to go async simply because the sheer # of page loads necessary to render a thread makes async almost a necessity.
- dahfizz 5y agoAgreed. Generally I prefer native apps, but HN is so well designed and so minimalist that I don't feel it needs a native client.
- pcr910303 5y ago> Does the Algolia hackernews api ( the specific API this client uses ) still require you to query in a tree like fashion, every comment item id if you want an entire page of comments? I’m using two different APIs — the inefficient API that requires you querying in a tree fashion is the HN official API[0], but there’s also the Algolia API[1], which is much faster and gives a much sensible data shape. I also do actually fetch the HN website as well — it’s needed for account/voting features. With these sources, it’s much faster than a usual client that gets it’s data from the official API. > The HN website I think is pretty ideal for the type of content its displaying, a native app doesn't give you much over having a HN tab open. I guess it’s a bit of difference on how one uses HN? I didn’t like HN tabs being mixed with other work—related tabs. I felt that having an app would be a perfect solution to me, but YMMV I guess. > The only benefit I see from a native app is the ability to save articles and comments for offline reading I guess that’s one more feature that I should add to my backlog :) [0]: https://github.com/HackerNews/API https://github.com/HackerNews/API [1]: https://hn.algolia.com/api https://hn.algolia.com/api
- krapp 5y agoOh wow, I... really wish I'd known about that second API a while ago. I gave up on writing my own client because HN's API was so frustrating.
- pcr910303 5y agoUnfortunately the second API is also a bit of a mess — the comment order is mixed up, so you have no option but to parse the HN HTML and sync the orders. I really wanted faster load speed (than slowly querying the tree-like API), so I did wrote that code…