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.
Related
I have suitation, where i have to get all the posts of Particular HashTag of Facebook. eg #ILovePhp . I have done some R&D and got my own profile hashtag posts/comments in format of JSON. But i want all the Posts of the particular HashTag(i.e a user who is not friend at all to me in facebook still he posted some message using the hash tag #ILovePhp) . I want to get all the posts in Facebook related to a particulat HashTag. Please help me.
Public Post Search has been removed, there is no way to get all posts of a particular hashtag anymore. You can read more about that in the changelog.
I want to get feed of friends whose are in the my friend list ({me/friends})
I have right permissions to do that. (user_friends and read_stream)
But the result of api doesn't show feeds of my friends properly ({user-id/feed})
To be exact, the result feeds are the part of the real feed.
What's wrong with that?
You cannot get the feed of friends specific to the friends list, but you can get the user's stream / home feed using:
/me/home
It shows all the posts by friends, pages, etc. In comparison, /me/feed shows what the user has posted.
Does anyone know of a way to retrieve the users entire news feed? Querying /me/home does filter some stories from. Also, it seems to retrieve the top stories. Is there any way to retrieve the latest stories?
It doesn't matter whether it's through the Graph API or FQL.
me/home is pulling posts in order of created date on my end
https://developers.facebook.com/tools/explorer/135669679827333/?method=GET&path=me%3Ffields%3Dhome.limit(20).fields(created_time%2Cupdated_time%2Cid)
try this as your query, you can mod fields to include any you need.
me?fields=home.limit(20).fields(created_time,updated_time,id)
if it is still out of order because of your cookie settings from the actual home feed, you can force it to reorder by passing the array in sort(); "php".
for sort() refer to: http://php.net/manual/en/function.sort.php
Using the Facebook Graph API how can find the most liked photo in an album on one of my pages?
I have access to the page insights if that can be used.
There are 200 photos in each album so I don't want to do an api request for each photo.
Subsequently you may also find the most commented on.
Here is the code you request:
http://fivespot.me/fblikes.php
$likes = $facebook->api('/'.$picId.'/likes');
However if you are looking to just find out the most liked there is an app already compiled that will do this for you:
http://apps.facebook.com/imanpic/
The Graph API doesnt support querying for an arbitrary set of photos with some criteria. BUT - you can access the Likes object for each Album, which returns a data set representing all the Liked Photos in that Album. You could then just walk that data set and count the number of times you see the same photo Like.
Thus - you just need to issue a Graph API call for Likes sub-object of an Album.
See "Likes" under "Connections" at:
http://developers.facebook.com/docs/reference/api/album/
Can anyone suggest how to track the comments and other objects (videos,photos,etc) which a user likes in facebook? Assuming that the user has registerd to my application.
You can use FQL with the like table.
http://developers.facebook.com/docs/reference/fql/like/
Reference includes examples.
But you can't get a list pf everything the user likes. If you know what object you want to track you can also use the link_stat table:
http://developers.facebook.com/docs/reference/fql/link_stat/