Is there any way I can retrieve twitter user's email Id (Objective-c)? - objective-c

https://dev.twitter.com/docs/faq#6718
If twitter doesn't provide any API, then how does foursquare retrieve them?
Foursquare has provision to list out the user's foursquare-friends who have registered with twitter.
It also provides API which shows friends of users who commonly appear in 'foursquare friend's list' as well as 'twitter followers list' of the user.
In both the above cases comparison can be made only through email.
Please help.

There's no way for you to get an e-mail from Twitter. Except, of course, by asking the person to give it.
What FourSquare does need no access to the e-mail. Matching is based on the Twitter name, not on the e-mail.
In the comments you say
My friend has registered in both Twitter and Foursquare. The only field common in her profile is the email id. No other fields match. She comes in the 2nd list which i have mentioned above.
but then you admit
After she has registered with FourSquare, went to her profile, clicked on friends -> Add Friends -> opted Twitter. She was asked to login to Twitter and thus she did it
This means that now FourSquare have access to her Twitter as well as your. Foursquare knows her Twitter id and your twitter id and can access Twitter (using Twitter API) to see who is following is following who. In other words when you say
The only field common in her profile is the email id. No other fields match.
You are wrong. Once she connected her FourSquare profile with her Twitter, all data that is accessible via Twitter API is in fact (at least potentially) part of her Foursquare profile.
But she needed to explicitly connect the two profiles (which she did when she opted to add friends to her Foursquare profile using Twitter).

Related

Using Instagram's Graph API, how can I retrieve post data (media url, caption, poster username, etc)

I want to use Instagram's Graph API on my backend server to retrieve data about an Instagram post. On my frontend, users will submit a post URL (like https://www.instagram.com/p/CAvPIm2lszQ/). Then on my backend, I want to take the ID of the post from that URL (so in this case CAvPIm2lszQ) and then I'm hoping that I can pass that ID thru the Instagram Graph API and then retrieve the data that I need (media URL, caption, poster username, etc.).
So would that be possible? I did find documentation on "IG Media" for the Graph API, but under permissions, it says, "A Facebook User access token from a User who created the IG Media object, with the following permissions.."
Unless I'm misunderstanding it, I'm not sure if I'll be able to access posts from various public accounts. I think it's also worth mentioning that my users are not logging into their Instagram accounts to use my service so the only possible "User access token" would be my own.
Any ideas on how I can go about this? I was using the instagram.com/p/{post_id}/?__a=1 endpoint to meet my needs before but it doesn't work on my production server for some reason. So I'm kinda stuck.
Most probably you will not be able to achieve that using Instagram API. First of all the ID you are referring to CAvPIm2lszQ is not the ID that you will use for getting IG Media. The ID is different (it's numeric value like in the sample request from the page you've linked). The full URL that includes CAvPIm2lszQ is in the shortcode field.
At the moment it is not possible to look for the post detail using shortcode. If you want to use that endpoint you need to get the real post ID first, for instance by listing list of posts from given user.
But in order to do so - you need to use Facebook login authorization window to get token from given user. Alternatively you can try to request https://developers.facebook.com/docs/instagram-api/guides/business-discovery but it requires going through App review and having your own company to pass the Business Verification. Keep in mind that this endpoint returns information only about Instagram Professional accounts (Business/Creator account). You will not be able to get information about regular accounts.
And the last thing about ?__a=1 endpoint. This is not the official Instagram API. They use it only for their own purposes. Most probably your server IP address has been blocked due to sending too many requests.

Is there a way to get four square users twitter id using foursquare API

Is there a way to get four square users twitter id using foursquare API
I have checked the gnip API, i have contacted them but the said it only supports enterprises
I need the users twitter id who checkin to specific locations using Foursquare so i can allow my users to communicate with them on my website
I need Anonymous users data and specifically not my friends data
Have a look at the Four Square API's documentation for a good place to start... It appears that this information is potentially available, however it might be dependent on you being "friends" with them or not:
If the user is a friend, contact information, Facebook ID, and Twitter handle and the user's last checkin may also be present.
The users endpoint will return a user object: This is available in their Compact and Complete objects, but not their "Mini" object.
contact: An object containing none, some, or all of twitter, facebook, email, and phone. Both are strings.

Services that get facebook emails

I've noticed that my android phone, the iphone, outlook.com, and yahoo mail all can import my friends' email addresses (and sometimes phone numbers) from facebook. However, I don't see anywhere in the documentation of the API to suggest that you can get email.
Do these services have special agreements with Facebook or am I just not finding the specific api for "contact" importing? I've not had any luck using "email" field with friends api.
Any ideas?
These services have some special agreements with Facebook and thus are able to retrieve the Email Ids of the Friends of the User. Most of them don't allow further exporting of data obtained from there directly.
And as per Email Permissions documentation here it clearly states that for App Developers
Note: There is no way for apps to obtain email addresses for a user's friends.
As per the phone number, there is no access to it no matter what permission. You may though ask the user to fill those for you.

Twitter doesn't provide email address for Rails integration

I've integrated social logins (Facebook, Twitter, etc.) with a Rails app using Devise and OAuth. The requests and callbacks all work great and users are able to authenticate the app and login efficiently.
My problem is this:
With Devise, my site has the user's email address as the username. So, whenever a user logs in through a social site for the first time, a 'connection' record is stored for their account to show which social sites they've logged in with. If they don't already have an account on my site, one is created with the email address from the callback array. The connection is then stored along with the returned tokens and secrets for later use (FB posts, tweets, etc.).
Unfortunately, Twitter doesn't provide the email address. To circumvent this, I'm asking first-time users that login with Twitter to simply provide an email address so an account can be created. However, I can't figure out what to do if they already have an account on my site. I can't check if they already do since I'm not given an email address to match up. This could ultimately cause a user to have multiple accounts.
So, I'm a bit at a loss, and if anyone has any suggestions, it would be extremely helpful.
Thanks! :)
You'll need to store some oauth provider info like {provider, twitter identifier} too to your database and then check twitter oauths based on that instead of the email ID.
The simplest thing to do would be to add a slightly different flow for if the login was via twitter. Ask a first time Twitter login user for the email ID. In your users table, add a column called tw_id and add the users twitter identifier. Next time, if the login is via Twitter, you check the tw_id instead of the provider email and proceed with the normal app flow.

Foursquare Checkins API

What are the informations from a user that are avaible, by default, for users that are not his "friend"s ?
Can i have the list of "checkins" from any Foursquare user only by making API requests ?
What kind of information about a user i can fetch, without having him as my friend (friend of the account used to perform the API requests) on foursquare ?
On linkedin, for example, i could fetch his Company, but if the user used to perform the API requests had this user as a friend, i could fetch the whole "company history" . Is there any restriction like this one on foursquare ?
Thanks in advance
You can try this out yourself at the API Explorer to see: https://developer.foursquare.com/docs/explore#req=users/1234
As you can see, even if you're not friends with this user, you can see their name, friends' names, contact info (Twitter/Facebook), and checkin counts, but not the actual checkins themselves. You will need to be friends with this user to see their checkin history.
Note that if you make this request without authentication (e.g., https://api.foursquare.com/v2/users/1234 with no oauth_token ) then you can't see any information about them.