Re:How Hacker News ranking algorithm works
by pypyguy on Monday October 11, 2010 @09:26PM
(#1781961)
Any genius willing to translate this to python?
[ Parent
| on HN ]
Re:How Hacker News ranking algorithm works
by sstrudeau on Monday October 11, 2010 @10:54PM
(#1782130)
There's a python implementation in the original article:
def calculate_score(votes, item_hour_age, gravity=1.8):
return (votes - 1) / pow((item_hour_age+2), gravity)
Re:How Hacker News ranking algorithm works
by zackattack on Monday October 11, 2010 @10:25PM
(#1782073)
I would prefer PHP but seconded
Re:How Hacker News ranking algorithm works
by sstrudeau on Monday October 11, 2010 @10:56PM
(#1782136)
This is pretty trivial but sure, something like:
function calculate_score($votes, $item_hour_age, $gravity=1.8) {
return ($votes - 1) / pow(($item_hour_age+2), $gravity);
}