Echo JS 0.11.0

<~>
fcambus 4687 days ago. link 2 points
Agreed, it's totally broken :(

The rankings somehow worked at the beginning but then started to become totally irrelevant, as the compute_news_score function does not take time in consideration.

Not sure what to do about it at the moment : sadly, Lamer News development is stalled, nothing has been pulled since early November. Will try to look into it next week.

From Lamer News source code :

# Given the news compute its score.
# No side effects.
def compute_news_score(news)
    upvotes = $r.zrange("news.up:#{news["id"]}",0,-1,:withscores => true)
    downvotes = $r.zrange("news.down:#{news["id"]}",0,-1,:withscores => true)
    # FIXME: For now we are doing a naive sum of votes, without time-based
    # filtering, nor IP filtering.
    # We could use just ZCARD here of course, but I'm using ZRANGE already
    # since this is what is needed in the long term for vote analysis.
    score = (upvotes.length/2) - (downvotes.length/2)
    # Now let's add the logarithm of the sum of all the votes, since
    # something with 5 up and 5 down is less interesting than something
    # with 50 up and 50 donw.
    votes = upvotes.length/2+downvotes.length/2
    if votes > NewsScoreLogStart
        score += Math.log(votes-NewsScoreLogStart)*NewsScoreLogBooster
    end
    score
end

# Given the news compute its rank, that is function of time and score.
#
# The general forumla is RANK = SCORE / (AGE ^ AGING_FACTOR)
def compute_news_rank(news)
    age = (Time.now.to_i - news["ctime"].to_i)+NewsAgePadding
    return (news["score"].to_f)/((age/3600)**RankAgingFactor)
end

Replies

floriancargoet 4686 days ago. link 2 points
I hope we can fix this. Newcomers may see this site as inactive since most news on the front page are weeks old :(
fcambus 4681 days ago. link 2 points
Yeah, it's especially flagrant on http://www.echolinux.com where most front page news are two months old..

I pinged Antirez about it, he told me he has been working on a fix which will be pulled this week. I'll update the site as soon as it's released :)