4

I want to implement something similar on my site.

Submissions have up_votes and down_votes. I'd imagine reddit does some sort of database query that takes into account the up_votes vs. total_votes and maybe factors in # of views and # of comments and limits it all by a specified time period.

What sort of query do you imagine they use to determine this?

Thanks!

goddamnyouryan
  • 6,854
  • 15
  • 56
  • 105

1 Answers1

6
  • For links, they use a formula based on upvotes minus downvotes combined with age of the post.
  • For comments, they use a confidence sort based on a Wilson score interval.

This blog post describes both formulas in greater detail.

hammar
  • 138,522
  • 17
  • 304
  • 385