使用 FQL 获取用户的所有点赞(全部)
我正在尝试使用 FQL 获得所有用户的喜欢。以下是我的研究,包括我尝试过的内容以及每次尝试遇到的问题。
1)最简单的方法是根据uid查询表。所以这会在其他人的直播中返回 57 个(对我来说)点赞。
SELECT object_id, post_id, user_id
FROM like
WHERE user_id = me()
XML 看起来像这样(注意无法解释的缺少 post_id)
<like>
<object_id>10150695050005313</object_id>
<post_id></post_id>
<user_id>xxxxxxxxxxx</user_id>
</like>
上面似乎是一个合乎逻辑的步骤,但是 Facebook 不索引 user_id 字段,因此我无法使用以下代码来获取更多详细信息。这段代码不起作用。
SELECT post_id, message
FROM stream
WHERE post_id IN (
SELECT object_id, post_id, user_id
FROM like
WHERE user_id = me()
)
2) 使用 Graph API:/me/likes/ 检索 95 个粉丝页面上的信息,但不检索照片、视频、链接或离线内容。完整网址为: https://graph.facebook.com/me/likes?access_token=< /a>
例如:
{
"data": [
{
"name": "BStU",
"category": "Organization",
"id": "136978696319967",
"created_time": "2011-06-29T12:09:17+0000"
},
{
"name": "Euchre",
"category": "Interest",
"id": "112355915446795",
"created_time": "2011-06-29T12:06:07+0000"
},
3) 此 FQL 返回与上述代码相同的内容,95 个粉丝页面:
SELECT page_id,name
FROM page
WHERE page_id IN (
SELECT page_id
FROM page_fan
WHERE uid=me()
)
总而言之,理想情况下,无论对象如何,我都能够返回用户的每个点赞。不过,如果我可以通过一个 FQL 查询将所有粉丝页面和流帖子连同数据一起返回,我愿意继续混合使用粉丝页面和流帖子。
有什么建议吗?我要补充的是,我尝试在不使用 REST API 的情况下执行此操作,因为它会降级(有一天?),因此使用 fql.multiquery 不是一个选项。
I'm trying to get ALL of a user's likes with FQL. Following is my research including what I've tried and the problems with each attempt.
1) The most simple method would be to query the table on the uid. So this returns 57 (for me) likes on other's stream.
SELECT object_id, post_id, user_id
FROM like
WHERE user_id = me()
XML looks like this (note unexplained absence of post_id)
<like>
<object_id>10150695050005313</object_id>
<post_id></post_id>
<user_id>xxxxxxxxxxx</user_id>
</like>
The above seems like a logical step, but Facebook doesn't index the user_id field so I can't use the following code to get further details. This code does not work.
SELECT post_id, message
FROM stream
WHERE post_id IN (
SELECT object_id, post_id, user_id
FROM like
WHERE user_id = me()
)
2) Using the Graph API: /me/likes/ retrieves information on 95 fan pages, but not from photos, videos, links, or offline content. The full url is: https://graph.facebook.com/me/likes?access_token=
For example:
{
"data": [
{
"name": "BStU",
"category": "Organization",
"id": "136978696319967",
"created_time": "2011-06-29T12:09:17+0000"
},
{
"name": "Euchre",
"category": "Interest",
"id": "112355915446795",
"created_time": "2011-06-29T12:06:07+0000"
},
3) This FQL returns the same as the above code, 95 fan pages:
SELECT page_id,name
FROM page
WHERE page_id IN (
SELECT page_id
FROM page_fan
WHERE uid=me()
)
So to summarize, ideally I would be able to return every like for a user, regardless of the object. I'm willing to move forward with a mixture of fan pages and stream posts though, if I can return them all, along with the data, with one FQL query.
Any suggestions? I will add that I'm trying to do this without using the REST API because it is going to be degraded (someday?) so therefore using fql.multiquery is not an option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经能够使用 FQL 来获取部分但不是全部的流点赞。请参阅:http://facebook.stackoverflow.com/questions/8496980/ fql-like-table-not-returning-any-results
我得到的查询是:
1) 给我在页面提要上喜欢的流项目:
2) 给我从我自己发布的提要中喜欢的流项目:
令人烦恼的是我无法从事件流项目、好友流项目、群组流项目等的流项目中获得用户喜欢即使我拥有该用户接受的所有权限。我又不是在询问秘密信息。当然,用户可以通过我的应用程序喜欢和删除喜欢的流项目。只是我无法查询到当前已被用户点赞过的流项目的完整列表。
I've been able to use FQL to get at some, but not all, of the stream likes. See: http://facebook.stackoverflow.com/questions/8496980/fql-like-table-not-returning-any-results
The queries I've got are:
1) Gives me stream items I've liked on page feeds:
2) Gives me stream items I've liked from my feed that I myself posted:
What's annoying is I cannot get user likes from stream items for Event stream items, Friend stream item, Group stream items, etc. Even though I have every permissions accepted for that user. It's not like I'm asking for secret information. As a matter of course, the user can like and remove likes of stream items via my app. It's just that I cannot query a complete list of the current stream items that have been liked by the user.
抱歉,您无法使用
/likes
端点获取某个人的所有点赞。我们将其限制为任何具有 FB 页面的内容,即任何开放的图形对象,无文章。例如,如果您喜欢一个og:type
为article
的开放图对象,我们不会在图 apilikes
中返回该对象> 终点。Sorry, you cannot pull all of the likes of a person using the
/likes
endpoint. We limit it to anything that has a FB page, which is any open graph object, sans articles. For example, if you like an open graph object that has anog:type
ofarticle
, we don't return that in the graph apilikes
endpoint.尝试这个 FQL 查询:
Try this FQL query: