hacker-news

JavaScript - Converting a Date() into seconds [duplicate]

别来无恙 提交于 2020-01-03 07:37:31
问题 This question already has answers here : Javascript Convert Date Time string to Epoch (7 answers) Closed 4 years ago . I'm using the Hacker News API made at Algolia here: https://hn.algolia.com/api I'm a bit confused as it says to search for posts since a certain time it says to run the following query: Comments since timestamp X (in second) http://hn.algolia.com/api/v1/search_by_date?tags=comment&numericFilters=created_at_i>X It says to replace X with a timestamp in seconds, but how exactly

How to update content popularity scoring such as Hacker News algorithm?

笑着哭i 提交于 2019-12-02 19:17:11
问题 I'm using a customized version of Hacker News popularity algorithm for my social site (items with a number of likes and comments). The algorithm works perfectly but I don't know how to update item scorings correctly (I'm storing the score in item model as meta data). Now I'm just updating scores on every new like and comment for items listed during past 9 days. This is really slow and resource heavy so I'm looking for a better way to keep scores up to date. Problem is that every item needs a

How to update content popularity scoring such as Hacker News algorithm?

倖福魔咒の 提交于 2019-12-02 08:01:34
I'm using a customized version of Hacker News popularity algorithm for my social site (items with a number of likes and comments). The algorithm works perfectly but I don't know how to update item scorings correctly (I'm storing the score in item model as meta data). Now I'm just updating scores on every new like and comment for items listed during past 9 days. This is really slow and resource heavy so I'm looking for a better way to keep scores up to date. Problem is that every item needs a new score when one changes to keep the time decay. What would be the better way to do this? I'm using