For documentation, please read this link http://www.rubydoc.info/gems/twitter#Documentation
User location will be a null object if user didn't input location.
Data needed: followers followings
Make client
client = Twitter::REST::Client.new do |config|
config.consumer_key = "YOUR_CONSUMER_KEY"
config.consumer_secret = "YOUR_CONSUMER_SECRET"
config.access_token = "YOUR_ACCESS_TOKEN"
config.access_token_secret = "YOUR_ACCESS_SECRET"
end
User Object
client.user
User Name
client.user.name
User Screen Name
client.user.screen_name
User Twitter URL
client.user.uri
User website
client.user.website
User Profile Image URL https
client.user.profile_image_uri_https
get all user followers
client.followers => user objects in array
client.followers.each do |follower|
p follower.name
end
=> p all followers name
get all user followings
client.following => user objects in array
client.following.each do |following|
p following.name
end
=> p all following names
For future project
client.search(":)", lang: "en", filter:"images", "retweeted": false).take(10).each do |tweet|
p tweet.text
end