Store a "score" to rank by in the database and then use some sort of time dependent function. AKA when you search the mongo for posts sort by "score."
Our score was calculated by something like this:
var gravity = 1.5;
var score = num_votes / Math.pow(t+2,gravity);
Gravity being how quickly a post would fall. Notice the t+2 ... it added 2 hours to all posts in order to eliminate things that were recently posted with like one vote sitting at the top.Then we'd just run this function through the whole database periodically (every 5 minutes or something).