Questions tagged [twitter-gem]

A Ruby wrapper for the Twitter API.

Provides a wrapper to the Twitter API. To install, grab the gem:

gem install twitter

Resources

See also

90 questions
0
votes
1 answer

uninitialized constant Twitter::OAuth

I'm struggling to get my app to display a timeline of feeds from my app. So far I've used the oauth-plugin, oauth and twitter gems (for rails3) to get it authorised. This has worked just fine. Now I'm struggling when I try and connect. I end up with…
Bob Sumo
  • 207
  • 1
  • 14
0
votes
1 answer

Error using Twitter gem, Errno::EAFNOSUPPORT

I am getting this error on my Heroku deployment: Errno::EAFNOSUPPORT: Address family not supported by protocol - socket2 usrruby19.2libruby1.9.1nethttprb:644:in initialize usrruby19.2libruby1.9.1nethttprb:644:in open …
Jaryl
  • 2,561
  • 1
  • 24
  • 33
0
votes
1 answer

How to get twitter user id matching a search query

I'm new to Ruby and I'm using sferik gem to get user id matching a search query (first result). The ultimate goal is to get users id matching with a column from a json file I've read the documentation but don't know really how start... any help…
handac
  • 13
  • 1
  • 6
0
votes
2 answers

How to determine how many more requests my app can make before it hits the Twitter API's rate limit?

My application habitually makes a request to the Twitter API for a user's timeline (the user's tweets). As an aside, I'm using the twitter gem and configured a Twitter client in order to enable my app to make the request: client =…
Diana E.
  • 309
  • 5
  • 11
0
votes
0 answers

Post on twitter using twitter gem - rails app

I'm using rails to build an application which allows users to authorize and connect to the Twitter API using their Twitter account. The log in works, but i have a problem with the posts (i'm using this gem): when i try to run rails db:migrate i get…
0
votes
1 answer

Searching for tweets by keywords and location on Rails

I'm new to Rails and developing in general and am trying to use the Twitter gem to search for tweets by location and keywords in my Rails app. Following the documentation at http://www.rubydoc.info/gems/twitter I have been able to figure out how to…
0
votes
1 answer

Ruby Twitter gem followers method repeating 20 times rather than displaying first 20 followers

so im using the ruby twitter gem and api in conjunction with omniauth, to log into twitter via a simple rails app, and return the first 20 followers of a user. The main piece of code to do this is a method in a lib file stating: def followers …
sdawes
  • 631
  • 1
  • 7
  • 15
0
votes
1 answer

Getting the favorite_count of a retweet Twitter REST API - twitter gem

I'm unable to get the favorite_count of a retweet from the JSON response of the Twitter REST api using the twitter-gem for my ROR app. The response returns 0 for the favorite_count of retweets. Is there a way to obtain this value from the response…
Michael Insalaco
  • 851
  • 2
  • 9
  • 12
0
votes
1 answer

twitter retweets api

I'm using twitter gem as a library to work with twitter api. I've noticed a weird issue with getting retweets for the tweet. Whenever I make a call I get only retweets from my mutual connections. So, if someone retweets my post I'll never be able…
msarvar
  • 45
  • 7
0
votes
1 answer

When I Search with Twitter Gem Remaining Rate Limit Is Decremented Twice

EDITED: reasonable answer at comments. I am looking for a way to check Twitter API rate limits before of making my consults but for the next snippet every time I call search , remaining is decremented twice instead of just once. user =…
Daniel García Baena
  • 1,191
  • 4
  • 19
  • 33
0
votes
0 answers

What is the best way to save tweets associated to a logged user in rails application?

I want to get my tweets using user_timeline()and save them to my application database. I'm not sure where to call that function and how to save each tweet associating with my user. This is the way I'm saving users to the database class…
0
votes
2 answers

Ruby on Rails - Issues with Iterating Through Twitter Gem Search Results

I've been using the Twitter Streaming API for a while with no problems, but recently switched over to using the REST and am a bit confused. I'm trying to iterate through the results of tweets using #vietnam. After reading the documentation, it…
CHawk
  • 1,346
  • 5
  • 22
  • 40
0
votes
1 answer

Delete Tweet with Twitter Gem

How do I delete a Tweet given it's ID? I've tried Twitter.status_destroy(1221312312) to no avail (undefined method) These also do not work: client.status(13123123123).delete client.status(13123123123).destroy
bevanb
  • 8,201
  • 10
  • 53
  • 90
0
votes
0 answers

Twitter bot retweeting same tweet causing it to crash

I'm trying to write a bot using ruby and the twitter gem. Here is my code : #!/usr/bin/env ruby require 'twitter' @client = Twitter::REST::Client.new do |config| config.consumer_key = "xxx" config.consumer_secret = "xxx" …
0
votes
2 answers

Using the twitter gem to retrieve all tweets containing a certain term, in a certain time window

I've been having a tough time finding info on this since the tweet count was restricted. I've started with this to get tweets in the last two week window: client.search( "to:justinbieber marry me", result_type: "recent", …
NNNNNNNNNNDelicious
  • 933
  • 3
  • 7
  • 19