Created
August 30, 2013 10:11
-
-
Save mehmetkose/6388375 to your computer and use it in GitHub Desktop.
Page Popularity Algorithm
This file contains 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
#!/usr/bin/env python | |
#Mehmet Kose 2012 - Popularity Algorithm | |
from time import time | |
simmdii = int(round(time() * 1000)) | |
def rank (time,like,unlike,visit,comment): | |
millis = int(round(time.time() * 1000)) | |
return ( millis - time ) / ((like*2)-unlike)*(visit+comment) | |
seconds = int(time()) | |
print rank(simmdii, 1, 40, 400, 20) | |
print "\n" | |
print rank(simmdii, 40, 1, 600, 20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment