Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def how_hot(topics, takes = 300)
results = do |topic|
tweets =, result_type: 'recent').take(takes)
next [topic, 0, 0] if tweets.empty?
[topic, (tweets.length / (tweets.first.created_at - tweets.last.created_at) * 60), tweets.length]
results.sort_by {|result| result[1] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.