How can I store post rankings that change with time?
Posted
by
Daniel Fein
on Pro Webmasters
See other posts from Pro Webmasters
or by Daniel Fein
Published on 2012-10-01T03:41:09Z
Indexed on
2012/10/01
3:51 UTC
Read the original article
Hit count: 300
php
I'm trying to learn how to code a website algorithm like Reddit.com where there are thousands of posts that need to be ranked. Their ranking algorithm works like this (you don't have to read it, its more of a general question that I have): http://amix.dk/blog/post/19588
Right now I have posts stored in a database, I record their dates and they each have an upvotes and downvotes field so I'm storing their records. I want to figure out how do you store their rankings? When specific posts have ranking values, but they change with time, how could you store their rankings?
If they aren't stored, do you rank every post every time a user loads the page?
When would you store the posts? Do you run a cron job to automatically give every post a new value every x minutes? Do you store their value? Which is temporary. Maybe, until that post reaches its minimum score and is forgotten?
© Pro Webmasters or respective owner