4 ms·
Ask HN/PG: Information on the algorithm behind story/comment ordering on HN?
I'm currently creating several community oriented websites and it's become obvious to me that one of the biggest challenges is making sure that new content gets noticed while reinforcing the importance of good content by rewarding good comments/stories with better placement.
To this end I am currently using a sort order based on an interpolation of rating and age. However, there is clearly a lot of room for improvement in my algorithm.
Before working to come up with something better from scratch I thought I would try to get some more info on the best algorithm I know of, the one used by Hacker News!
My current algorithm (in SQL) is fairly crude but seems to be working to an extent:
( rating - ((UNIX_TIMESTAMP(UTC_TIMESTAMP()) - UNIX_TIMESTAMP(created_at)) / 43200 ) ) DESC
Suggestions for improvement welcomed...
- mixmax 17y agoSome time back PG posted the exact algorithm used. If you search through his history you'll be able to find it. Use searchyc.com to do it.
- aarongough 17y agoThank-you mixmax. I had looked for this before, but last time I searched using Google and came up with no useful results. For posterity: PG explaining the algorithm that determines the 'hotness' of an item here: http://news.ycombinator.com/item?id=38704 http://news.ycombinator.com/item?id=38704
- aarongough 17y agoI just saw why you knew the answer to this question, you posted a similar question a while back! History repeats... http://news.ycombinator.com/item?id=166833 http://news.ycombinator.com/item?id=166833