FAQ

SPINRANKER uses the powerful and balanced algorithms of WPeddit for WordPress as its base code for ranking posts. The details of the algorithms are from a very useful website here. SPINRANKER has customized in ranking system to try an reflect the fair and balanced views and votes from our visitors. Editors will continue to review and update the systems on an ongoing basis.

Digging into the post ranking code

The post ranking algorithm is included in the plugin and written here

function wpeddit_post_ranking($post_id){
	$x = get_post_meta($post_id, 'epicredvote', true );
	if($x == ""){
		$x = 0;
	}
	$ts = get_the_time("U",$post_id);
	if($x > 0){
		$y = 1;
	}elseif($x<0){ 		
                $y = -1; 	
        }else{ 		
                $y = 0; 	
        } 	$absx = abs($x); 	
        if($absx >= 1){
		$z = $absx;
	}else{
		$z = 1;
	}
	$rating = log10($z) + (($y * $ts)/45000);
	update_post_meta($post_id,'epicredrank',$rating);
	return $rating;
}

In mathematical notation the hot algorithm looks like this:

reddit_cf_algorithm

Effects of submission time

Following things can be said about submission time related to story ranking:

  • Submission time has a big impact on the ranking and the algorithm will rank newer stories higher than older
  • The score won’t decrease as time goes by, but newer stories will get a higher score than older. This is a different approach than the Hacker News’s algorithm which decreases the score as time goes by

Here is a visualization of the score for a story that has same amount of up and downvotes, but different submission time:

reddit_score_time

The logarithm scale

The hot ranking uses the logarithm function to weight the first votes higher than the rest. Generally this applies:

  • The first 10 upvotes have the same weight as the next 100 upvotes which have the same weight as the next 1000 etc…

Here is a visualisation:

reddit_log_function

Without using the logarithm scale the score would look like this:

reddit_without_log

Effects of downvotes

Reddit is one of the few sites that has downvotes. As you can read in the code a story’s “score” is defined to be:

  • up_votes – down_votes

The meaning of this can be visualised like this:

reddit_up_down
This has a big impact for stories that get a lot of upvotes and downvotes (e.g. controversial stories) as they will get a lower ranking than stories that just get upvotes. This could explain why kittens (and other non-controversial stories) rank so high 🙂

Conclusion of the algorithms

  • Submission time is a very important parameter, generally newer stories will rank higher than older
  • The first 10 upvotes count as high as the next 100. E.g. a story that has 10 upvotes and a story that has 50 upvotes will have a similar ranking
  • Controversial stories that get similar amounts of upvotes and downvotes will get a low ranking compared to stories that mainly get upvotes