简体   繁体   English

如何让所有朋友都喜欢在Facebook上?

[英]How to get all friends like on Facebook?

I would like to get all likes of a user's friend on Facebook. 我想在Facebook上获得用户朋友的所有喜欢。 So far I know how to take all likes of an authenticated user by FQL query: 到目前为止,我知道如何通过FQL查询接受已认证用户的所有喜欢:

SELECT object_id, object_id_cursor,object_type, post_id, post_id_cursor, user_id FROM like WHERE user_id =me()

However I'd like to have similar information about ALL user's friends. 但是,我希望获得有关所有用户朋友的类似信息。
So the question is how to get all likes from user's friends. 所以问题是如何从用户的朋友那里得到所有的喜欢。 Does anybody can give me a hint on it? 有人能给我一个提示吗?

I don't think it's possible to get all with FQL, you need to get a list of the user's friends id's, and then run the query against each friend.. 我认为使用FQL不可能获得全部,您需要获取用户的朋友ID的列表,然后针对每个朋友运行查询。

$friends = array(); //an array of user ids
foreach($friends as $value){
    //Create query
    $fql = "SELECT object_id, object_id_cursor,object_type, post_id, post_id_cursor, user_id FROM like WHERE user_id = $value";
}

However I don't think you want to go with FQL , you can do things in an easier manner using the graph API with batched requests (you'll end up with hundreds of API calls if you do this in FQL, and will probably end up with your APP blocked by facebook) 但是我不认为您想使用FQL ,可以将图形API与批处理请求一起使用,以更轻松的方式进行操作(如果在FQL中执行此操作,则将产生数百个API调用,并且可能会结束与您的APP被Facebook阻止)

So far you can take only URLs that your friends have liked. 到目前为止,您只能接受朋友喜欢的URL。 Here is the FQL request to do it: 这是执行此操作的FQL请求:

SELECT url FROM url_like WHERE user_id={friendId}

All friend ids you can get by fql query or by API call. 您可以通过fql查询或API调用获取所有朋友ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM