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
2 answers

Putting the Rails Twitter Client initializer in an Initializer

I have an initializer twitter.rb: require 'twitter' client = Twitter::REST::Client.new( { :consumer_key => "", :consumer_secret => "", :access_token => "", :access_token_secret=> "", …
NNNNNNNNNNDelicious
  • 933
  • 3
  • 7
  • 19
0
votes
1 answer

Twitter::Error::Forbidden - Unable to verify your credentials - Twitter gem in Rails

I'm using the Twitter gem to try and post a list of tweets from an account on my webpage, however I keep getting the 'Unable to verify your credentials' error. I've even put the |config| block in the controller to try and narrow down what's going…
0
votes
1 answer

Twitter ruby gem .search request multiple responses

In the following code I specify that I want to make 1 request to the twitter api, but when I puts the output to terminal I continue to receive many responses until I kill the program. How can I limit it to only the specified amount of requests? I am…
Michael
  • 6,561
  • 5
  • 38
  • 55
0
votes
2 answers

Delete retweet using Twitter gem

I'm working on a project that uses the Twitter ruby gem, and I want to be able to "undo" a retweet. I've had no luck so far by trying to search for the original tweet and then removing the first occurrence, if it belongs to me. There's an unfavorite…
Blease
  • 1,380
  • 4
  • 38
  • 64
0
votes
1 answer

Twitter gem: how to avoid searching deeply with max_id?

I want my app to search tweets with a specific #tag on Twitter every few minutes, like this: results = client.search("#mypopulartag") However, I don't want to do a full search each time. In building the app, I've encountered the…
bevanb
  • 8,201
  • 10
  • 53
  • 90
0
votes
0 answers

Storing data from Twitter API in Rails

Before I begin, I'm still learning the whole MVC frame work so please be understanding in your explanations. I am making a call to the Twitter API using the Twitter Gem. Im gathering all of my followers and returning their names and gender using…
jthedudeoflife
  • 391
  • 1
  • 4
  • 11
0
votes
1 answer

This webpage has a redirect loop - Rails

I'm trying to get my app to redirect to a custom route when it encounters the error: Twitter::Error::TooManyRequests However, I'm having difficulty for some reason and i keep getting this error: This webpage has a redirect loop Here's my…
Robbo
  • 1,292
  • 2
  • 18
  • 41
0
votes
1 answer

For the twitter gem on rails, how do I efficiently call user_timeline and grab tweets for multiple users?

In my rails controller, I have an array called "usernames" which just has 10 twitter handles without the "@" symbol. I am storing the latest tweet of these users in an array called "tweets" with the following assignment: tweets =…
Emil
  • 1,131
  • 13
  • 23
0
votes
1 answer

Ruby-on-rails: routing problem: controller action looks for show when it should look for finalize

background: trying to use the twitter gem for ruby-on-rails. in routes: map.resources :twitter_sessions map.finalize_twitter_sessions 'twitter_sessions/finalize', :controller => 'twitter_sessions', :action => 'finalize' (twitter_sessions is the…
cbrulak
  • 15,436
  • 20
  • 61
  • 101
0
votes
1 answer

Verify if a request is GET / POST

I am using the twitter gem for ruby and need to send a POST request to users/lookup endpoint. As per the gem source code documentation(https://github.com/sferik/twitter/blob/4e8c6dce258073c4ba64f7abdcf604570043af71/lib/twitter/rest/users.rb), the…
user_stackoverflow
  • 734
  • 2
  • 10
  • 18
0
votes
1 answer

Is it possible to mark a tweet field in_reply_to_status_id pointing to a RT?

I am using Twitter Ruby Wrapper API for Rails( https://github.com/sferik/twitter ), when I do like: client.update("Replying a Retweet", :in_reply_to_status_id => twitter_being_replied_id) It returns a Tweet with a null in_reply_to_status_id…
Jirico
  • 1,242
  • 1
  • 15
  • 29
0
votes
2 answers

Trouble Getting Twitter Gem To Work - Giving Undefined Method Errors

I am following along with the documentation for the Twitter gem and trying to get some results, but I am getting the following error: undefined method `sample' for nil:NilClass I've put this in my config/initializers/twitter_credentials.rb (my keys…
user2270029
  • 871
  • 14
  • 27
0
votes
1 answer

Rails 4 trouble using module in controller

In my rails 4 app I'm having trouble extracting the twitter gem config from my controller to a module, getting undefined method `include' for # Users_controller.rb def show include Twitconfig …
0
votes
1 answer

Integrating Twitter Feed in Rails 4 App

I'm trying to integrate twitter feed into my rails four 4 app, a cms for that matter. I settled of twitter gem and had it successfully installed. I set up the following in application_controller.rb. class ApplicationController <…
the Areba
  • 501
  • 3
  • 16
0
votes
2 answers

Error while downloading tweets using twitter gem on ROR

I am able to integrate the twitter gem into my rails application, but sometimes its works and mostly time it gives this error. Here is the snippet of my server response(framework trace) on this weird error. twitter (5.4.1)…
live_alone
  • 159
  • 1
  • 11