Trending algorithm in PHP?

Discussion in 'PHP' started by tinman47, Aug 27, 2015.

  1. #1
    I'm working on a personal project that organizes songs uploaded by the frequency of votes in a certain amount of time, and maybe some sort of base score (probably how many likes something has, or plays). I've seen some trending/hot algorithms, but the problem is that they have downvoting, while my system does not. Can anyone give me insight on how to perform something like this in PHP?

    This is what my idea is so far:

    $s = $row['song_stat_plays'];
    $s = $s + (2 * $row['song_stat_downloads']);
    $s = $s * (3 * $row['song_votes']);
    $TrendScore = floor(log(max($s,1)));
     
    tinman47, Aug 27, 2015 IP