Created
September 22, 2018 09:20
-
-
Save paractmol/7e74474f8f450563a8398fff55c0dbdb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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