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.
Related
So this is how I'm retrieving Facebook friends and profile picture right now:
https://graph.facebook.com/{{user_id}}/?fields=picture,friends&access_token={{app_id}}|{{app_secret}}
However, the photo I get with it is small and the only way to get a large photo is:
https://graph.facebook.com/{{user_id}}/picture?type=large&access_token={{app_id}}|{{app_secret}}
So now I have to make two get requests; one for a large photo, and one to get the friends. I want to achieve both in one request. Is that possible?
Thank you.
The call
/{user_id}?fields=id,name,friends,picture.type(large)&access_token={access_token}
should do what you desire.
On my website there is possible post image from computer. But I would like also provide user to post image from facebook user album. I can imagine some dialog like "Facebook login" which will open faceook images and provide user to send image from facebook to my application. Does something like that possible? Many thanks
Yes, it is possible.
I assume you have a little experience with facebook api.
trigger login FB login window and request user_photos permission
make a query to facebook to get (all/random/a few) user albums like so me/albums?fields=id,count
If a key count is set, there are photos
(I would collect all IDs of albums containing photos and make a query to facebook with ech one ID)
Then again, query to facebook like so /%album-id%?fields=photos.fields(images)
Now you have an array of URLs of images which, for example you show to a user and after he selects, you download it and upload to your server
Since you did not request a solid code, I will provide you with at least with a little snippet, or show an illustration how to do that. http://paste2.org/hvGkngIL. (a metod index) (Might not work properly, since I cut it from a PHP framework I work with)
I need to get a list of a facebook user checkins both in photos and in status.
I tried to use graph api to query /me/locations' like:
$this->api->api('/me/locations?limit=1000');
It returns me a list of user checkins with three different types: photo, checkin or status.
My problem is that I need to get the photos that have user checkins but I can't seem to find it.
Can anyone help?
Thanks
If you look at the User documentation, under the title feeds, it lists a method of fetching only the posts which have a location (Checkin) in it.
https://graph.facebook.com/me/feed?with=location
As for getting Photos with a location (Checkin), there doesn't seem to be any documentation that suggests that the Photos can be filtered similar to the way Posts can be filtered. At best, I guess you will have to fetch all photos and then filter out the ones that do not have the place tag. Posts use the location tag while Photos use the place tag.
How can I get the facebooks' user cover photo via the PHP SDK?
Thanks in advance.
B.W.
I have tried to loop through the Graph API, but it didn't work because the album was in the second page, and wasn't displayed.
There's no way to get this without looping through the album list - you could specify a higher limit in the request for the initial list of albums if you really need to do this without paginating through the albums
I need to get the URL's and names of the Photos contained in a Facebook Photo Album.
I know this is possible through graph.facebook.com but I don't know where to find the ID of an Album.
As an example you can use this Album: http://www.facebook.com/media/set/?set=a.210725979538.130908.69116329538
Which one of the Numbers is the Album ID? And How do I get the Photo URL's with name??
Thank you in advance.
Just get the /albums relationship. For your example:
http://developers.facebook.com/tools/explorer/?method=GET&path=thebeatles%2Falbums
Then use 10150213069439539/photos to get the photos of the first album (or any other album you want, just change the id based on what you got from /albums).
I suggest you to read the whole Graph API Core Concepts page and trying its examples.
And also read the album and photo documentation.