get user picture together with AppID/score - facebook

From the Facebook Graph API explorer I'm submitting a Get function for AppID/scores. Apart from user, score and application data, I would like to get user's picture as well. What Graph API query can I submit to achieve this?

You can simply reference the users id in a URL similar to this:
https://graph.facebook.com/USER_ID/picture
Here is a live example:
That image was rendered with this code:
<img src="https://graph.facebook.com/4/picture" width="50" />

http://graph.facebook.com/XXXXXX/picture
Change XXXXX To the user ID :)

Related

Get current user newsfeed along with post author picture

I'm trying to obtain all newsfeed posts of the current user along with each post author picture url in a single query, but I cannot succeed.
I can get current user newfeed by calling "/me/home" in Graph Api, and I can get a specific user picture by calling "{user_id}/picture". How can I get every post author picture of my newsfeed in one single query?
Thanks in advance!
Pablo
You can use field expansion to get at this. The one complicating factor is you will have to manually request all the fields you need now. Try this query:
me/home?fields=from.name,from.picture,message,picture
This is pretty easy actually. Use the /me/home query as you have been. But instead of makin a call to /user_id/picture you can just do this in HTML:
<img src="https://graph.facebook.com/{user_id}/picture?type=square" />
E.g.: https://graph.facebook.com/4/picture?type=square

Creating a Photo Stream

I want to use the graph api to create a photostream of all the users friends photo's. How do you create a thing like that using the graph api. I guess in essence I want to create a chronological photo album of all my friends photos.
How should I go about accomplishing this.
You should start by getting the user's friends using /me/friends. Then you can cycle through the list of friends and get their photos like:
<img src="http://graph.facebook.com/{friend_id}/picture" />
You can use a JavaScript library to do the animation...
I eventually solved this by saving the entire image collection of a facebook user in the app's database and querying them SORT BY datetime.

How do i get someones profile picture to display back to them?

How do i get someones profile picture to diplay back to me. I have already gotten permissions to use the user's pictures etc i just don't know how to use their profile picture and display it back to them.
Any help would be awesome
Calling on the Graph API
http://graph.facebook.com/[id]/picture
The following will give you different sizes
http://graph.facebook.com/[id]/picture?type=square
http://graph.facebook.com/[id]/picture?type=normal
http://graph.facebook.com/[id]/picture?type=large
So you can just put these URLs straight in an <img> tag
EG: <img src="http://graph.facebook.com/4/picture?type=square" />
See:
http://developers.facebook.com/docs/reference/api/#pictures
These are in the public domain, so there is no need for any authentication.

Get the profile picture with the Facebook C# SDK

I would like to get the profile picture. Can I do that with the Facebook SDK, and how?
When I use the Api.get option I get a jsonreader exception.
You can render the photo by just doing:
<img src="https://graph.facebook.com/**id**/picture"/>
in your page (obviously changing the id to the id of the user).
You don't have to retrieve it using the API, but you do have to retrieve the id.
You can also get pictures by their id using /photoid like so /98423808305
You can find more information here - http://developers.facebook.com/docs/graph-api

How to get a profile picture from fb:friends selector

Im a Newbie to PHP and FBML(Facebook Markup Language).....so now im coding a Facebook app so I need to get profile picture and friend name when I select a name from FB:Friend Selector
Select a Friend <fb:friend-selector uid="exclude_ids" name="pal" idname="friend_sel" />
I use exclude_ids to see all friends in my selector so how to get profile picture? I can get name from this but how to get the profile pic large?
As you said, you are already able to get the name, for picture, you can put new graph api to use for getting photo easily:
Example url for my pic:
http://graph.facebook.com/sarfraz.anees/picture
So you should simply replace the sarfraz.anees above with the facebook id of a user to get his profile image.
So you can show the profile pic of a user like this:
<img src="http://graph.facebook.com/sarfraz.anees/picture" />
/picture?type=large or /picture?type=normal