Discover the most viral and socially-shared content on the web in real-time.

Text

image

Thalmic Labs (YC W13) MYO

  • The Next Generation Of Gesture Control
  • Preorder for $149
  • www.getmyo.com
  • @thalmic
  • 10K Pre-Orders In 2 Days, $1.5M In Sales

image

Scout Alarm (out of Sandbox Industries)

image

CubeSensors (just launched at #Launch2013)

image

Google Glass (out of Google X Lab)

image

Scanadu Scout

Romotive Romo

Text

A lot of questions come in asking about the ranking of content and transparency of what factors are used in the algorithm. In this post, I’ll try to explain how the Trendn ranking algorithm works and how you can use it in your own application. It is a very simple ranking algorithm and works very well to rank what is trending.

The ranking algorithm looks like this

Score = P / (T+2)^G

Where,
P = points of an item (I will discuss this number next)
T = time since submission (in hours)
G = Gravity, defaults to 1.8

Now to explain..

P = Points of an item: This essentially is the sum of all the social engagement factors. For example, we use the Facebook API to get the amount of likes, shares and comments. Many other factors are used:
Twitter - Tweet Count
Digg - Digg Count, Comment Count
Reddit - Votes, Comment Count
Bookmarks - Delicious, Google Reader
Hacker News - Points, Comments

T = Time since submission: The score decreases as T increases, meaning that older items will get lower and lower scores.

G = Gravity: The score decreases much faster for older items if gravity is increased

Now, to implementation in both Python and PHP.

Python:

def calculate_score(votes, item_hour_age, gravity=1.8):
      return (votes - 1) / pow((item_hour_age+2), gravity)

PHP:

function calculate_score($votes, $item_hour_age, $gravity=1.8) {
    return ($votes - 1) / pow(($item_hour_age+2), $gravity);

}