How to get friend's movie ratings - facebook

I am trying to build an app and my requirement is to get ratings given to all the movies of a user.
I was able to find this tutorial which describes how to get likes but not ratings.
https://developers.facebook.com/blog/post/2011/03/18/how-to--use-the-graph-api-to-pull-the-movies-friends-like/
Furthermore, I was able to find out this documentation
https://developers.facebook.com/docs/reference/opengraph/action-type/video.rates/
But I am not sure if it can be done for user's friends and how to do it.
Can someone help me out ?

You could try below path,
me/friends?fields=video.rates

Related

Deezer API : get user's favorite genres

I'm using the deezer API and I wonder if there is a way to find user's favorite genre ?
The only solution I found is to search for every user's favorite album (https://api.deezer.com/album/105374). But this requires a lots of request !
I wonder if it's possible to get several album details in one time ? (e.g. https://api.deezer.com/album/105374,1053743). Or maybe something else ?
Thank you !
Unfortunately, there is no way to get that information directly. What you can do is to get the top tracks/albums with http://developers.deezer.com/api/user/charts, and look for the genre.
There is no possibility too to get several albums in the same request.

How to get all user's likes using facebook's graph API

How can I query facebook's graph API to retrieve all user's likes (not only pages but also photos and others)?
For instance, how could I get all the pictures a user has liked? Using facebook's search bar you can find them easily by clicking on "photos has liked".
I wrote a script that scrapes the page content and does that but it's not very efficient.
I have recently come accross a similar problem, maybe this helps you solve it.
https://graph.facebook.com/v2.5/{page_id}/feed?fields=likes.limit(1).summary(true)&since={start_date}&until={end_date}&access_token={access_token}
This will give you a list of all posts that received likes during the specified time period. If you manage to write a code summing up the following JSON path you got your sum for "all user's likes":
data[0].likes.summary.total_count
Not entirely sure is this is exactly what you were searching for, hope it helps you though - and if not you, someone else.
As for likes you can also use the same way to extract Shares and Comments:
Shares
https://graph.facebook.com/v2.5/{page_id}/feed?fields=shares&since={start_date}&until={end_date}&access_token=
Comments
https://graph.facebook.com/v2.5/{page_id}/feed?fields=comments.limit(1).summary(true)&since={start_date}&until={end_date}&access_token=
Best regards
There isn't to my knowledge any way to get this from the API without grabbing every type of response from the API and then sorting through for likes. Facebook search bar uses an internal API different from the Graph API.

Facebook Graph API: Get post/status attached photos

How can one get multiple attachments of a post/status in a group?
For example: A group status that some member wrote and added multiple photos to..
Currently I am using Graph api to get the group stream with group_id/feed and unable to see images attached to a single status - while accessing the feed from Facebook itself I can validate that there are few photos attached to the status.
Using FQL it is possible to get the attachments with the following query:
SELECT attachment FROM stream WHERE post_id = each_post_id
Considering I will have to send this request per post and that FQL will soon be gone I am searching for an alternative.
I was looking for a solution for this as well and actually just found it.
The Facebook Platform changelog says the following:
/v2.1/{post-id} will now return all photos attached to the post: In
previous versions of the API only the first photo was returned with a
post. This removes the need to use FQL to get all a post's photos.
With this knowledge I went to the Graph Api Explorer and found a post that had 2 attachments or more added to it.
After finding the post, and with that the post id, I tried the request Facebook told me to do:
/v2.1/{post_id}
This does NOT give you the desired result. The nice thing about the explorer is that you can search for fields you want to add to your request.
You want to add the attachments (plural) field. NOTE: It might be that the graph api explorer only shows the attachment (singular) field. This is NOT right.
So, to summarize:
Get the post id of the post containing the images.
Create a new request to the graph api that looks something like: /v2.1/{post_id}?fields=attachments
Then read the result to get your desired attachments.
I hope this helps you out as I have been struggling for a while as well.
KR
PS: This is tested with a user and not a group, but it should be basically the same.
PS2: This is just an explanation of how you get attachments of a single post. You can also add the attachments field to the /me/home egde to immediately get all attachments at every post like so:
me/home?fields=message,from,attachments
PS3: The permissions you need are
user_status
read_stream
user_photos
user_videos
Facebook is not very clear on this matter and it is very hard to figure things out like this. So I hope this will help everyone that is searching for this solution.
I answered for the same question here : /v2.1/{post-id} does not deliver photos
It seems it's a Facebook bug. My colleague opened an issue. Here's the link: https://developers.facebook.com/bugs/762280800482269/
You also can find some info here:
https://developers.facebook.com/bugs/790976317600139/
Hope it will help you.

Get facebook user checkins

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 do I get a list of friends who clicked "Like" on an external page?

PART A -
There are many many questions like this, but none of them seem to provide a working solution. I want to get a list of friends who clicked the Facebook "Like" button on an external site.
NOTE: This is NOT for a Facebook page. In this case, I know I can query the page_fan table.
To get the list of Facebook page-likes for example, I can use the url_like table. I guess I just want a way to invert this table. I know I cannot get a list of ALL people that liked a link due to privacy concerns, but I want a list of my friends alone - which should be fine.
I know facebook does this internally every time I see a Facebook Like button... right below that there is statistics about my friends that also like the same link. How do I get this using FQL?
PART B
Equivalently, how do I get a list of friends that shared a specific URL as a link? I cannot search the link table by url because that is not indexed. Also, the link_id is not the same as the Open Graph ID of the URL.
I tried select link_id from link where url="http://urladdress.com/a/b.html" and owner in (select uid2 from friend where uid1=me()) but that neither throws an error not returns anything... just stalls.
Part A: you can't.
Part B: you can't the way you are trying. You might be able to get the feed for every one of the users friends and look for that url from their feed, but it will be painfully slow.
Lots of people would like to know this but Facebook is (rightfully so) not giving this information out. That is why you see lots of questions regarding it but no working solutions.
You could possibly look into the read_insights permission. You might not be able to get the exact information about "likes" (yet)... but you will be able to get other possibly useful information.