Alex Rivera | Logout

Get all of a user's likes (all of them) with FQL

Asked 2011-06-30T00:39:04.237
12

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 
Edit
Report

1 Answer

1

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 an og:type of article, we don't return that in the graph api likes endpoint.

answered 2011-07-19T12:50:56.357

Your Answer