devise-twitter icon indicating copy to clipboard operation
devise-twitter copied to clipboard

How to update status from app

Open krzkrzkrz opened this issue 14 years ago • 7 comments

Is there a way to connect to twitter's api to upate a users status using this gem? Or should another approach be used for this?

In theory the app should communicate with http://dev.twitter.com/doc/post/statuses/update to update a users status. Is this already supported or still has to be implemented?

krzkrzkrz avatar Sep 29 '10 10:09 krzkrzkrz

Currently the best approach IMO would be to use the twitter gem: http://twitter.rubyforge.org/

You have access to all necessary tokens through the user model.

I might add a nicer interface for it.

MSch avatar Sep 29 '10 10:09 MSch

So just to be clear. Devise-twitter for twitter authentication and the twitter gem for twitter interaction right?

krzkrzkrz avatar Sep 29 '10 10:09 krzkrzkrz

Yes.

I just looked at the documentation for the twitter gem

oauth = Twitter::OAuth.new(Devise::Twitter.consumer_key, Devise::Twitter.consumer_secret)
oauth.authorize_from_access(current_user.twitter_oauth_token, current_user.twitter_oauth_secret)
client = Twitter::Base.new(oauth)

should work.

MSch avatar Sep 29 '10 10:09 MSch

Lovely, thanks for the prompt reply :-)

krzkrzkrz avatar Sep 29 '10 10:09 krzkrzkrz

Additionally, will devise-twitter support communicating with the twitter api (i.e. updating twitter status, etc) or is this beyond the scope of this gem, since it is only meant for devise and twitter authentication?

krzkrzkrz avatar Sep 29 '10 12:09 krzkrzkrz

I'll support integration with the twitter gem but no more, since that clearly falls in the domain of the twitter gem.

MSch avatar Sep 29 '10 12:09 MSch

tried installing the twitter gem with rails 3 and get an error on startup (issue: http://github.com/jnunemaker/twitter/issues#issue/67).

Instead, I am now using: twitter_oauth (http://github.com/moomerman/twitter_oauth) which works without any problems

krzkrzkrz avatar Sep 29 '10 13:09 krzkrzkrz