Skip to content

Instantly share code, notes, and snippets.

@josepjaume
Last active December 17, 2015 10:59
Show Gist options
  • Save josepjaume/5599354 to your computer and use it in GitHub Desktop.
Save josepjaume/5599354 to your computer and use it in GitHub Desktop.
Futuroscope post examples
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(:+)
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
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