How to request a similar account of a facebook object such as an album or photo via fql?

Here's a tricky question: how do you get as many facebook objects as an album or photo? I know that facebook has an fql table called link_stat that allows you to get a counter for an external URL, but it does not work if the object is on facebook. If you access similar ones using the opengraph api on a specific object, it will return a maximum of 4 users who like the object, even if perhaps several thousand users who like it. Any clues?

+4
source share
5 answers

I was able to do this by changing the privacy settings. If you request tables for XYZ users, they will not return data until the user sets the visibility for friends (for a photo, album, video, link or note), regardless of whether you requested permission (from your application).

So, for example, I am an XYZ user, and I liked the specific link posted by my GHI. and I use an application developed for Facebook that allows access to my links. Now, if the application tries to access the links that I liked on Facebook, the application will not be able to get the link posted by GHI (which I liked) until the GHI establishes the visibility of its links to friends.

If someone needs more help, return to this forum.

Regards, Harun

+1
source

See http://developers.facebook.com/docs/reference/fql/like

You can do fql query to get a list of similar ones based on object_id, and then make an account.

+1
source
# fql query $fql = "SELECT like_info FROM photo WHERE object_id=" . $photo_id; # api request $request = array( 'method' => 'fql.query', 'query' => $fql ); # run batch request $likeInfo = $facebook->api(array( 'method' => 'fql.query', 'query' => $fql )); var_dump($likeInfo);die; => get like info of photo`enter code here` 
+1
source

Obviously, the answer has changed a lot since you first asked the question, but here is the answer for today. Use the Facebook API to figure out how to get information about each photo in an album from Facebook:

 https://graph.facebook.com/albumID/photos?fields=id,likes.summary(true),comments.summary(true)&after=XXXXXX&access_token=XXXXXX 

Use Ajax to send a GET request:

 $.ajax({ dataType: "json", method: "GET", url: "https://graph.facebook.com/" + albumID + "/photos", data: {fields: "id,likes.summary(true),comments.summary(true)", limit: 100, after: afterStr, access_token: token}) 

The variable 'afterStr' is the identifier of the next data page.

Then to count likes and comments we received from Facebook:

 var dArr = msg.data; var i = 0; for (i = 0; i < dArr.length; i++) { like += dArr[i].likes.summary.total_count; comment += dArr[i].comments.summary.total_count; } 

Send the result to your HTML using ID:

 $("#likeID").html(like); $("#commentID").html(comment); 

We work a demo here .

Hope this helps!

+1
source

These days, if you know what type of message you are requesting, you can use FQL. For example, if you want to know how much you liked for a photo, you can use:

 SELECT like_info FROM photo WHERE object_id = 414122065292107 

Which returns the following:

 { "data": [ { "like_info": { "can_like": true, "like_count": 1354, "user_likes": false } } ] } 

Similar approaches exist for different types of content, but for me this seems inconsistent, so see the FQL documentation.

https://developers.facebook.com/docs/reference/fql/

0
source

Source: https://habr.com/ru/post/1312825/


All Articles