You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The trees command currently has to make a request for every single comment. Algolia have an endpoint that bundles the entire thread together into a single request.
wget 'https://hn.algolia.com/api/v1/items/25015967' 0.03s user 0.04s system 0% cpu 41.368 total
/tmp % ls -lah 25015967
-rw-r--r-- 1 simon wheel 3.7M Jul 24 20:31 25015967
The text was updated successfully, but these errors were encountered:
The
trees
command currently has to make a request for every single comment. Algolia have an endpoint that bundles the entire thread together into a single request.https://hn.algolia.com/api/v1/items/ID
Here's an example that loads quickly, with about 50 comments: https://hn.algolia.com/api/v1/items/27941108
It doesn't appear to use pagination at all - if a thread is big then the response is big.
I ran this search to find some stories with more than 1000 comments: https://hn.algolia.com/api/v1/search?tags=story&numericFilters=num_comments%3E=1000
Here's one: https://news.ycombinator.com/item?id=25015967 with 4759 comments. Hitting the API takes 41s and returns 3.7 MB of JSON!
The text was updated successfully, but these errors were encountered: