5 ms·
They fall over time. The algorithm simply needs the date the item was created at and the amount of points. The difference is that instead of doing the calculat
by sktrdie 14y ago
They fall over time. The algorithm simply needs the date the item was created at and the amount of points.
The difference is that instead of doing the calculation from the "time since submission" (which changes over time and, as you say, won't work with Couch's views which can't emit values as time goes on) it does the calculation using the "created_at" property. In essence the outcome is the same.
Here's the algorithm I use which needs some better documentation :) https://github.com/lmatteis/hckr.it/blob/master/common/util.js#L2 https://github.com/lmatteis/hckr.it/blob/master/common/util....
- ecesena 14y agoIt's the reddit's algo, isn't it?
- jkap 14y agoI believe reddit's gives newer posts more points, rather than taking away points from older posts. I might be wrong, though. It's been a while since I've looked at that part of the code.
- ecesena 14y agoMmm... not so sure. One of the nice features of reddit's algo is that it doesn't require to evaluate the score based on the current time, as this one. http://amix.dk/blog/post/19588 http://amix.dk/blog/post/19588 There are also a few similarities like max(abs(points+1),1), log base 10...
- dmragone 14y agoThat's pretty much how it works (as explained by reddit co-founder Steve Huffman in Udacity 253 course - sorry I forget exactly which video he says it).