Created
December 1, 2015 15:30
-
-
Save bdwill/f9a60b6281e5b6f0ef08 to your computer and use it in GitHub Desktop.
Interacting with Twitter API using Twitter ruby gem
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 'twitter' | |
require 'json' | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = "..." | |
config.consumer_secret = "..." | |
config.access_token = "..." | |
config.access_token_secret = "..." | |
end | |
followers = client.followers("username") | |
for user in followers do | |
if user.location.include? 'Orleans' | |
puts "#{user.name} lives in '#{user.location}'" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment