Skip to content

Instantly share code, notes, and snippets.

@nikukyugamer
Created February 19, 2017 13:54
Show Gist options
  • Select an option

  • Save nikukyugamer/5385683941f9fba8603f76a7c008d97e to your computer and use it in GitHub Desktop.

Select an option

Save nikukyugamer/5385683941f9fba8603f76a7c008d97e to your computer and use it in GitHub Desktop.
Get someone's Twitter favorite list
require "twitter"
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
screen_name = target_screen_name
COUNT = 100
favorite_tweets = client.favorites(screen_name, {count: COUNT})
favorite_tweets.each do |fav_tweet|
puts "#{fav_tweet.attrs[:id]}, #{fav_tweet.attrs[:created_at]}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment