Closed seanwmitchell closed 5 months ago
require "x"
x_credentials = {
api_key: "INSERT YOUR X API KEY HERE",
api_key_secret: "INSERT YOUR X API KEY SECRET HERE",
access_token: "INSERT YOUR X ACCESS TOKEN HERE",
access_token_secret: "INSERT YOUR X ACCESS TOKEN SECRET HERE",
}
x_client = X::Client.new(**x_credentials)
user = x_client.get("users/me?user.fields=public_metrics")
user["data"]["public_metrics"]["followers_count"]
Thanks for a very useful gem.
I tried to upgrade from the twitter-ruby gem to this new x-ruby gem and can't get follower counts data.
The
x_client.get("users/me")
method returned just a couple data points not including thefollowers_count
.I am able to send posts/tweets so its not an authentication issue.
On the previous gem, I have this code working perfectly to collect
follower_counts
:Any suggestions of how to do it on the new x-ruby gem?