Twitter oauth parameter - twitter

I'm using abraham's twitter oauth and I cannot figure out how to get email parameter, it does not provide a list of parameters. I tried using $content->{email}; but it returns a blank array, any idea how can I get the email?

There is NO way you can get email address of a twitter user. Twitter doesn't provide it in their API.
https://dev.twitter.com/docs/faq#6718

Related

Get Twitter id with Screen Name

Hi I'm trying to get Twitter ID by Screen name..
Screen name is: KTutorials
Here is my link to get Twitter Id
https://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=ktutorials&count=5000
But I'm getting this error.
{"errors":[{"code":215,"message":"Bad Authentication data."}]}
Here is my Twitter link https://twitter.com/ktutorials
Any Help?
I can see that you are using Twitter API to GET followers/ids method. GET request for this method require OAuth Signature. This means that you should have Twitter App created and if not, you should have create one here.
Subsequently, you should visit GET followers/ids documentation page, and get OAuth Signature using the "OAuth Signature Generator" located at bottom of page.
Bad Authentication data tells that you it can't do the operation due to the bad authentication.
From API V1.1, all requests should be authenticated first. So, create
an app in Twitter console and put the important keys like Access keys
and Consumer keys.
If you feel you are authenticated user, then re-generate your token and give another try!

Omniauth twitter login doesn't work

I am using omniauth to login with twiiter/facebook account in my site. It works great with facebook but it doesn't work with twitter. On checking log I found that twitter API doesn't send user email id back in response and in my application database email id is mandatory field.
Just wonder why email id is not sent back in response.
Is there any setting which prevents sending email id back in response?
Twitter does not provide email. This is because twitter privacy policies.
You can find the following information here: ( https://dev.twitter.com/docs/faq)
"The Twitter API does not provide the user's email address as part of the OAuth token negotiation process nor does it offer other means to obtain it."
You have to make an extra step (on your site), where you ask the user his email.
Regards
Ivangrx

Rails - Twitter API: how to get from ID link to Twitter profile?

From the Twitter API I obtain user's ID (of course beside profile link, username etc). How can I display the link to user's profile according his ID?
For example, Facebook API provide user's ID as well, and if I put to the browser www.facebook.com/users_id, I'll get his profile...
Is there any way to do with Twitter? www.twitter.com/users_id returns empty page...
EDIT: obviously I can save user's URL (or his username), but the respective user can whenever change it...
what do you call a twitter "profile" ? I guess you talk about the user timeline
according to the api doc, your url should probably look like this :
https://api.twitter.com/1/statuses/user_timeline.html?&user_id=(your_id_here)
however, i would advise to use one of the twitter api gems to ease your pain...

OAuth, Twitter and Indentity - who am I?

Once authenticated to Twitter via OAuth I did not see a good call to get your username.
How is this supposed to work? I'd like to pull back things like Twitter username, firstname, lastname, etc... basic profile stuff. Should the OAuth handshake give me my username?
Try this:
https://dev.twitter.com/docs/api/1/get/account/verify_credentials
It'll show you all information (you'ld normally get of any other user) of the OAuth-authenticated-account =)!
First, Twitter includes the screen_name parameter in the access token response. Second, you can call http://api.twitter.com/1/account/verify_credentials.json to get the full profile which will also include the name (JSON key 'name'). Twitter does not provide email addresses.
Have you tried any of these libraries? I've tried just about all of the php ones and all that I tried had examples on how to get the user data.

RoR - How to obtain an access token for the facebook user using OAuth?

i want create something like "link_to" which can link to "request for permission" in facebook, so if user click "allow" then redirect to my site and i can get their data.
my question is how to create a "link" like that? so i can get access token from facebook user. (i had register my app)
thx..
Better explained here:
http://ggomeze.com/2011/05/19/post-to-facebook-from-rails-app
It's quite simple. Just redirect the user to the Facebook Auth Page:
https://graph.facebook.com/oauth/authorize?
client_id=...&
redirect_uri=http://www.example.com/callback&
scope=user_photos,user_videos,publish_stream
There're several optional parameters you can pass to get the required site.
For further Information just read the corresponding paragraph on the Facebook Documentation ("Authenticating Users in a Web Application"):
http://developers.facebook.com/docs/authentication/

Resources