Skip to content

Instantly share code, notes, and snippets.

@sorenmacbeth
Forked from ealdent/tunkrank.rb
Created May 27, 2010 23:17
Show Gist options
  • Save sorenmacbeth/416503 to your computer and use it in GitHub Desktop.
Save sorenmacbeth/416503 to your computer and use it in GitHub Desktop.
class TwitterUser
def calculate_tunkrank(p=0.05)
self.followers.inject(0.0) do |sum, follower|
sum + ((1.0 + (p * follower.tunkrank_score)) / (1.0 + follower.num_friends))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment