by pg · 16y ago · 0 comments
(= gravity* 1.8 timebase* 120 front-threshold* 1
nourl-factor* .4 lightweight-factor* .17 gag-factor* .1)
(def frontpage-rank (s (o scorefn realscore) (o gravity gravity*))
(* (/ (let base (- (scorefn s) 1)
(if (> base 0) (expt base .8) base))
(expt (/ (+ (item-age s) timebase*) 60) gravity))
(if (no (in s!type 'story 'poll)) .8
(blank s!url) nourl-factor*
(mem 'bury s!keys) .001
(* (contro-factor s)
(if (mem 'gag s!keys)
gag-factor*
(lightweight s)
lightweight-factor*
1)))))If you're just submitting interesting URLs and worry about them being shunted off the main page by gravity then there are no practical differences.
Sorry I can't be more transparent about how contro-factor is calculated, incidentally. Its purpose is to recognize flamewars.
def calculate_score(votes, item_hour_age, gravity=1.8):
return (votes - 1) / pow((item_hour_age+2), gravity) function calculate_score($votes, $item_hour_age, $gravity=1.8) {
return ($votes - 1) / pow(($item_hour_age+2), $gravity);
}I think I may have just reinvented the way reddit does it :P