jimmySixDOF
a year ago
Love that you have been improving this idea since 2012 !! I think enriching HN is a super interesting problem I have also thought about quite a lot. The realtime angle looks really good fun to see likes/page position as it happens. I notice you show "Top Comments" in the details and wonder how you determine this since afaik there is no concept of likes for individual comments only stories from the API. I need go looking at the API again I found one method somewhere that would return the whole story with all comments fully sorted in order together in a single json so I guess if the "best" comments float to the top of their branch you could track that over time. Just curious and wanted to say this looks amazing !!
burmecia
a year ago
Thanks, the "Top Comments" is sourced from the "kids" field of the "items" endpoint. As the API docs (https://github.com/HackerNews/API?tab=readme-ov-file#items) says, it is "in ranked display order" so I just used it to sort the top comments.
jimmySixDOF
a year ago
Yah that makes sense and after looking I could not find the API call that pre sorted each thread (it must not have been native algolia or firebase) - and without that the way you are doing it sure beats recursively reconstructing the thread. All the best and I look forward watching any features you add in the future!