Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def how_hot(topics, takes = 300)
results = topics.map do |topic|
tweets = @client.search(topic, 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]
end
results.sort_by {|result| result[1] }
end
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.