Skip to content

Instantly share code, notes, and snippets.

@mehmetkose
Created August 30, 2013 10:11
Show Gist options
  • Save mehmetkose/6388375 to your computer and use it in GitHub Desktop.
Save mehmetkose/6388375 to your computer and use it in GitHub Desktop.
Page Popularity Algorithm
#!/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