Last active
December 17, 2015 10:59
-
-
Save josepjaume/5599354 to your computer and use it in GitHub Desktop.
Futuroscope post examples
This file contains 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
require 'futuroscope/convenience' | |
searches = ["Ed Balls", "Lady Gaga", "Justin Bieber"] | |
results = searches.future_map do|search| | |
Twitter.search(search, lang: 'en').results.length | |
end | |
puts results.inject(:+) |
This file contains 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
require 'futuroscope/convenience' | |
edballs = future{ Twitter.search('Ed Balls', lang: 'en').results.length } | |
ladygaga = future{ Twitter.search('Lady Gaga', lang: 'en').results.length } | |
justinbieber = future{ Twitter.search('Justin Bieber', lang: 'en').results.length } | |
puts edballs + ladygaga + justinbieber |
This file contains 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
edballs = Twitter.search('Ed Balls', lang: 'en').results.length | |
ladygaga = Twitter.search('Lady Gaga', lang: 'en').results.length | |
justinbieber = Twitter.search('Justin Bieber', lang: 'en').results.length | |
puts edballs + ladygaga + justinbieber |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment