devise-twitter
devise-twitter copied to clipboard
How to save twitter data on local db
Hi, great plugin! And I hope that the development goes on for this gem.
I am wondering. I am able to do a sign-in with Twitter. My db stores twitter_handle, twitter_oauth_token and twitter_oauth_secret. However, my user model also has other fields such as: full_name, description, url, followers_count, friends_count, photo_caption, photo_file_name, etc, which are all fields from the user twitter api (http://dev.twitter.com/doc/get/statuses/show/:id)
I need to populate these fields in my local db. How should this be done?
I think I need to add a callback for that.
MSch, can you be more descriptive? :-) Where should the callback be written? Perhaps a quick sample?
That way other devs might find it useful
Well after warden hands devise-twitter all the data, devise-twitter disregards everything but the tokens. This is where I'm going to add the callback.
Oh right, ok. Looking forward to it. When can we expect this? :-) Just need a date, so I can start integrating other stuff on my app
Well I wanted to work through the issues soon anyways, so I might as well start today. :)
You've got twitter/email/jabber? May I ask for feedback on some API parts?
MSch, oooh so sorry. Im still very new to Ruby/RoR. Previously using PHP/Symfony and relied on my own PHP lib to process Twitter callbacks for data to be saved locally... Code was a bit messy, but it worked.
Never mind then :)
By the way, reading your previous comment about the twitter gem. Once a user is saved in the db using devise-twitter. Can't I use the twitter gem (http://twitter.rubyforge.org/) to do a lookup on the user and save data locally?
Maybe a callback from devise-twitter is not needed for this?
Yes, that would work fine, (just see the other issue for how) but you'd incur another request to the Twitter API.
Hmm, ahh yea. Another request would occur. Will be looking forward to your callback implementation then
Any updates on this? :-)
MSch, I am trying to fork this and would need to callback method which is needed so I can add/copy the users twitter details onto the local db when he logs on via the app.
Its quite an important aspect in the app...
As such, where would it be appropriate to create such a method? Which file? Your feedback will be appreciated