Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

If really there is no fresh meat for the home page, popolate it using…

… very old news in the right order.
  • Loading branch information...
commit a5a0c841d6129be98c5e3bac6ad7aeda5795751f 1 parent 2ff998a
@antirez authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 app.rb
View
5 app.rb
@@ -1236,8 +1236,9 @@ def compute_news_score(news)
# The general forumla is RANK = SCORE / (AGE ^ AGING_FACTOR)
def compute_news_rank(news)
age = (Time.now.to_i - news["ctime"].to_i)
- return 0 if (age > TopNewsAgeLimit)
- return ((news["score"].to_f-1)*1000000)/((age+NewsAgePadding)**RankAgingFactor)
+ rank = ((news["score"].to_f-1)*1000000)/((age+NewsAgePadding)**RankAgingFactor)
+ rank = rank-1000 if (age > TopNewsAgeLimit)
+ return rank
end
# Add a news with the specified url or text.
Please sign in to comment.
Something went wrong with that request. Please try again.