سؤال

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!

هل كانت مفيدة؟

المحلول

  • 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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top