Ruby twitter gem. how to get people who favorite my posts

125 Views Asked by At

Im trying to make an app which would iterate through my own posts and get a list of users who favorited a post. Afterwards I would like the application to follow each of those users if I am not already following them. I am using Ruby for this.

This is my code now:

@client = Twitter::REST::Client.new(config)
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
user = @client.user()
tweets = @client.user_timeline(user).take(20)
num_of_tweets = tweets.length
puts "tweets found: #{tweets.length}"
tweets.each do |item|
    puts "#{ item}" #iterating through my posts here
end

any suggestions?

1

There are 1 best solutions below

0
ScottM On

That information isn't exposed in the Twitter API, either through a timeline collection or via the endpoint representing a single tweet. This'll be why the twitter gem, which provides a useable interface around the Rest API, cannot give you what you're after.

Third party sites such as Favstar do display that information, but as far as I know their own API does not expose the relevant users in any manageable way.