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
15
votes
6 answers

OAuth::Unauthorized 401 int twitter-omniauth gem

I have been trying to authenticate users using twitter-omniauth gem for last days, yet not successful. (Authentication with facebook works perfectly) I'm keep getting 401 Unauthorized error. I search through stackoverflow, but none of the answers…
robert
  • 8,459
  • 9
  • 45
  • 70
12
votes
3 answers

Recommended twitter gem for ruby-on-rails

I've found a couple of different twitter gem (for ruby-on-rails) out there: http://twitter4r.rubyforge.org/ http://twitter.rubyforge.org/ But I'm wondering if someone can rate them and provide a recommendation of either one or a new one. Thanks
cbrulak
  • 15,436
  • 20
  • 61
  • 101
5
votes
1 answer

Uploading multiple images on twitter using Ruby on Rails Twitter Gem

What should be the format for the parameter: media , in the call below, for updating with multiple images. def twitter_status_update_with_media (twitter_client, text, media, opts) twitter_client.update_with_media(self.text, media,…
Nikunj Jain
  • 103
  • 1
  • 10
4
votes
1 answer

Oembed tweet - twitter gem

This is probably a terribly simple question but i can't figure out how to render an embedded tweet. For simplicity, this is my controller: class TweetsController < ApplicationController def index @tweet =…
Robbo
  • 1,292
  • 2
  • 18
  • 41
3
votes
3 answers

How do I authenticate users in a Rails app with the oauth gem and twitter 1.0.0 gem?

Jnunemaker just updated his twitter gem (https://github.com/jnunemaker/twitter) and removed the Twitter::Oauth class. My code doesn't look much like his example, so I'm having issues updating it. Here's what my code used to look with the twitter 0.9…
kateray
  • 2,066
  • 4
  • 18
  • 23
3
votes
3 answers

undefined method `get_access_token'

My twitter controller code is this class TwitterController < ApplicationController before_filter :authenticate_user! def index unless TwitterOauthSetting.find_by_user_id(current_user.id).nil? redirect_to "/twitter_profile" end …
3
votes
1 answer

With the twitter gem, how do I retweet a Twitter::Tweet from Twitter::REST:Tweets.retweet?

I have an instance of Twitter::Tweet, which does not have a method retweet. ( http://www.rubydoc.info/gems/twitter/Twitter/Tweet ) However, Twitter::REST::Tweets does have a method I can use to retweet. (…
oceanician
  • 399
  • 4
  • 14
3
votes
1 answer

How to perform users search using twitter ruby gem

How to perform this call using the twitter gem? I tried: client.search('sachin') but that returns Twitter::SearchResults which contains only tweets.
Raj
  • 22,346
  • 14
  • 99
  • 142
3
votes
2 answers

Twitter gem best practice - controller vs. initializer

I have a registered app on Twitter and am able to post to my twitter feed. However, I can only get it to work when I put the initializer in my controller's create action. client = Twitter::REST::Client.new do |config| …
brad
  • 1,675
  • 2
  • 16
  • 23
3
votes
1 answer

Why can't I modify a frozen Time in Twitter gem?

I have a Tweet object from the twitter gem, called @tweet. I am able to do: @tweet.created_at --> `@tweet.created_at.class` outputs `Time` However, I want to change the timezone of created_at, so I tried: @tweet.created_at.utc And got: can't…
Hommer Smith
  • 26,772
  • 56
  • 167
  • 296
2
votes
1 answer

Ruby: How to pass options to user_timeline method of twitter gem?

I am using sferik gem to get tweets. I want to pass following extra parameters to method "user_timeline": count, include_rts and exclude_replies Is it possible to pass these in as parameters? If yes, how can I pass these extra parameters to…
Shashi
  • 35
  • 1
  • 6
2
votes
1 answer

How do I use the Ruby twitter gem to get a list of followers for a given ID/handle?

I want to use v5.0 of the Twitter gem, and I can't figure out the documentation to understand how to get a list of followers, given a handle. It looks like previous versions had a method that looked something like Twitter.follower_ids('ID to…
sameers
  • 4,855
  • 3
  • 35
  • 44
2
votes
1 answer

Twitter gem usage - Faraday builder error

I’m trying to use twitter gem and getting Faraday::Builder is now Faraday::RackBuilder when I run the code. Anybody else got this or have idea how to resolve it
Aniruddha
  • 3,157
  • 4
  • 32
  • 48
2
votes
1 answer

Twitter rails gem Update_with_media returns Unauthorized

I'm using the Twitter gem to authenticate and share content to twitter. I need to include an image as well so I'm using the "update_with_media" method, like so: def tweet client = Twitter::REST::Client.new do |config| config.consumer_key …
Breno
  • 5,952
  • 1
  • 20
  • 25
2
votes
1 answer

How can I retrieve my profile with the twitter gem

client = Twitter::REST::Client.new do |config| config.consumer_key = "XX" config.consumer_secret = "XY" config.access_token = "ZZ" config.access_token_secret = "ZZZ" end How can I retrieve my profile information?
Boti
  • 3,275
  • 1
  • 29
  • 54
1
2 3 4 5 6