Created
April 28, 2011 14:59
-
-
Save jashkenas/946506 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (= gravity* 1.8 timebase* 120 front-threshold* 1 | |
| nourl-factor* .4 lightweight-factor* .3 ) | |
| (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)) .5 | |
| (blank s!url) nourl-factor* | |
| (lightweight s) (min lightweight-factor* | |
| (contro-factor s)) | |
| (contro-factor s)))) | |
| (def contro-factor (s) | |
| (aif (check (visible-family nil s) [> _ 20]) | |
| (min 1 (expt (/ (realscore s) it) 2)) | |
| 1)) | |
| (def realscore (i) (- i!score i!sockvotes)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment