Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to save twitter data on local db #9

Open
krzkrzkrz opened this issue Sep 29, 2010 · 12 comments
Open

How to save twitter data on local db #9

krzkrzkrz opened this issue Sep 29, 2010 · 12 comments
Labels

Comments

@krzkrzkrz
Copy link

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?

@MSch
Copy link
Owner

MSch commented Sep 29, 2010

I think I need to add a callback for that.

@krzkrzkrz
Copy link
Author

MSch, can you be more descriptive? :-) Where should the callback be written? Perhaps a quick sample?

That way other devs might find it useful

@MSch
Copy link
Owner

MSch commented Sep 29, 2010

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.

@krzkrzkrz
Copy link
Author

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

@MSch
Copy link
Owner

MSch commented Sep 29, 2010

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?

@krzkrzkrz
Copy link
Author

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.

@MSch
Copy link
Owner

MSch commented Sep 29, 2010

Never mind then :)

@krzkrzkrz
Copy link
Author

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?

@MSch
Copy link
Owner

MSch commented Sep 29, 2010

Yes, that would work fine, (just see the other issue for how) but you'd incur another request to the Twitter API.

@krzkrzkrz
Copy link
Author

Hmm, ahh yea. Another request would occur. Will be looking forward to your callback implementation then

@krzkrzkrz
Copy link
Author

Any updates on this? :-)

@krzkrzkrz
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants