Here are a few examples that might be useful for anyone using sferik twitter gem for something like this. Note that I am currently using version 5.0.0, so your mileage may vary.
Assuming you set up a REST client and assign it a variable called client , you can get an array from your last 20 references (or no matter how much you received in the last 2 months, if less), this line:
client.mentions_timeline.map(&:full_text)
Relevant references to these tweets can be obtained in a similar way:
client.mentions_timeline.map(&:user).map(&:username)
Then you can use client.update as prompted to answer as you like.
One tool that I find incredibly useful when I learn the APIs in Ruby, pry . Just require , release binding.pry and run your code in the terminal. Then you can explore your heart - or an API limitation.
Oi
source share