How do I get user info like profile picture, location, description etc.
I have a field in form called google+ url. Now If any user filled it with their google+ url, I want to get their profile picture, location and description using their google+ url, Is it possible without creating google+ application?
A Google+ URL generally contains the Google+ ID for a user. You can parse out that ID, and then make a people.get API call using the ID. The response will only contain information that is publicly available on the user's profile, though. Also, if a user is verified, their URL will not contain their ID, but rather their verified name, but this will also work as an ID.
In PHP, the call looks like: $me = $plus->people->get('{{ID}}');
You can learn more about the people.get API call and see a full example at https://developers.google.com/+/api/latest/people/get.
Related
I have a registration plugin embeded via an iframe on my website, The registration plugin works fine , I am also able to get the unique user_id of each user by using the following line of code in the signed_request file which can be located here
The line of code i use to get the user_id is: $response["user_id"];
Now that i have a unique id of each user, i want a way by which i can get the link to the profile image of that user, i know i can get the thumbnail of the profile picutre
using open graph,
But i am looking for a way by which i can get the link to the complete or the original profile picture, not the thumbnail.
Is there a way this can be done? Using open graph or something like that?
You need user_photos permissions first. Then something like this should do it:
SELECT cover_object_id FROM album WHERE owner=me() and type='profile'
Substitute me() with the user you are querying for.
It returns the photo object that you can then use to pull the full version from.
Make an API call to /user_id/?fields=picture using the access_token in the same signed_request
I'm trying to get details of a user from his/her LinkedIn profile using JavaScript API. but the problem is i only getting the details such as firstName, lastName, headline and profile picture. other than that i'm not able to get anything.
I have followed the tutorial in Linkedin Developer and i want to add fields like industry, network, date-of-birth, main-address,
They are right here: https://developer.linkedin.com/documents/profile-fields
But the point is accessing those fields for another account (not yours or your API key) might be not possible due to policies.
Update for comment:
I assume you are following the guide in the link you provided first and you are already getting the results you want (name, picture etc...). For the other fileds just provide the field name in the link I pasted above and see what happens. for example change the field line to:
IN.API.Profile("me") .fields(["industry", "network", "date-of-birth"])
That is use the field names in that link and do wathever you want with the returned data.
I'm tryin to develop a (almost) 100% client-side dynamic website by integrating it with twitter, facebook and flickr.
I've been able so far to get the last 4 tweets (with javascript) from my client's feed, and now i was wandering if i could do the same with facebook's gallery and events from their feed.
Especially, what i need (given the facebook username/api key/whatever)
gallery
for each gallery in user's profile:
get the gallery name
get the first picture
get the gallery url
news/events
for each news/event/post in user's profile:
get the event name
get the event text
get the event picture (if provided)
get the event url
I don't want to use the facebook widgets with their rendering, i just need to read the json response (if there's any) and put the data inside my website (like a preview).
Since my client is pretty rusty with "computers (cit.)" but he's (not so strangely) comfortable with facebook/twitter/flickr, i tought about a solution like this before adding a database and an admin interface to our website.
I found some resources online, so i think it's possible (in a way or another). I'd like to do it in javascript, but if it's php i won't complain.
Check out this API to get photoes from the user profile
http://developers.facebook.com/docs/reference/api/album/
This is for events
http://developers.facebook.com/docs/reference/api/event/
You can use either the PHP or the Javascript API SDKs:
http://developers.facebook.com/docs/reference/php/
http://developers.facebook.com/docs/reference/javascript/
respectively. Naturally you would handle the returned information differently. Both have a method called api() which can be utilised to grab the album and event objects (as mentioned in another answer):
http://developers.facebook.com/docs/reference/api/album/
http://developers.facebook.com/docs/reference/api/event/
You can pass parameters in the methods to restrict the results returned by fields, number of items, sizes of images etc. This is outlined here:
http://developers.facebook.com/docs/reference/api/
But the issues you are going to face is that you have to authorise your "app" - think website when they use the terminology "app" - to give it permissions to access the information. This takes the form of a two step process. You have to create the app on the Facebook platform which can then access the API methods (only certain information can be got from the API methods without an authenticated app).
The second part is that the user themselves must then authenticate their facebook account against your app - this gives your app permission to access the user's information. In plain English it would go like this:
User visits your webpage; user must be logged into Facebook and must approve your app (this used to be called Facebook Connect for obvious reasons); the app and the user account are "connected"; the app can then use the api methods you've written to return information about the connected user
The beginning explanations of how to do this are here:
http://developers.facebook.com/docs/authentication/
The only way you can access a user's (non-public) information from outside of Facebook is via a connected app and user profile.
I have a database of people's names and LinkedIn profile URLs.
Annoyingly there isn't a standard format for LinkedIn URLs (like twitter) but there are generally in the form of:
1) http://www.linkedin.com/in/geoffroyondet
2) http://www.linkedin.com/profile/view?id=34178115
On my site I want to display people's LinkedIn details.
I've got OAuth working fine and for people with the first format (above) I can successfully display their LinkedIn data on my site. I'm using the "Public Profile URL" option from https://developer.linkedin.com/documents/profile-api
But for the second format I'm having problems. It's invalid as a "public profile" and the ID in the URL doesn't seem to be the "member_id" from the link above.
Btw, if I try to use this numeric ID as a member_id I get the following error:
object(SimpleXMLElement)[652]
public 'status' => string '404' (length=3)
...
public 'message' => string 'Invalid member id {34178115}' (length=28)
From poking around with the API the only way I can get the alphanumeric id (member_id) is from a successful API call (blah->person->id). But to make a successful API call I first need a valid URI. So it seems to be a chicken and egg situation.
Any suggestions as to how I can display LinkedIn data by using the second URL above?
Looks like there are two issues here at play:
1) The technical issues. You are correct that you cannot retrieve a user's profile via the Profile API via the second URL, you can only do it via the unique public-profile-url, via the member ID, or via the ~ to retrieve the current user's profile.
Member ID is not related to the number you see in the query string - the member ID is a alphanumeric token generated uniquely for each user for each API application, so user A via your application will have a different member ID than the same user A via my application.
Are you just retrieving the member profiles arbitrarily or are you trying to retrieve profile information from connections of the viewing authenticated user? You should be able to either pull the viewer's connections public-profile-url, or pull it via a People Search, etc.
2) The platform guidelines. Basically, you can only show profile information about a particular LinkedIn user to viewers by pulling the information on behalf of that user. Meaning, that the viewer has authenticated against the API; you don't mention whether this will be the case, but adhering to #2 will potentially help solve #1.
Can you post a photo to the wall of a friend of the logged-in user using the FB Graph API? I could find no posts that answered this exact question but if there are please point me in the right direction.
I have tried the code found in answers to this question to post a photo, but no matter what user id is used in the call to api, the photo gets added to an album on the logged-in user's profile.
Is it possible to post a photo to another user's profile - just like one any user can manually add to someone's Wall Photos? i.e, a post that will have type: "photo" in the graph API instead of type "link".
Even while going through the old publish documentation, they specify you can only include attachments using links to the media you'd like to attach and not by uploading directly through the API. Looks like this is the route you're going to have to go (using the link property you've already mentioned)