Skip to content

Instantly share code, notes, and snippets.

@bdwill
Created December 1, 2015 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdwill/f9a60b6281e5b6f0ef08 to your computer and use it in GitHub Desktop.
Save bdwill/f9a60b6281e5b6f0ef08 to your computer and use it in GitHub Desktop.
Interacting with Twitter API using Twitter ruby gem
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