Alex Rivera | Logout

Getting user likes of stream items via FQL (posts, comments, pictures, links, etc)

Asked 2011-12-13T22:14:35.443
11

I need assistance in getting user likes of stream items via FQL. I've got some of the likes coming back, but cannot figure out how to get others. For the access_token, every permission is granted.


Let me show you what I've been able to do:

postings I've liked on Page feeds:

fql?q=Select post_id, source_id, message FROM stream where source_id in (SELECT target_id FROM connection WHERE source_id=me() and is_following=1) AND likes.user_likes=1 LIMIT 10 Note: This worked as of mid Dec 2011 when the original question was posted. Now (mid Feb 2012) it is no longer returning anything liked stream content from a page.

postings I've liked of posts that I posted:

fql?q=Select post_id, source_id, message FROM stream where source_id=me() AND likes.user_likes=1 LIMIT 10


Here's what I'm missing

postings I've liked on friends' walls:

fql?q=Select post_id, source_id, message FROM stream where source_id in (SELECT uid1 FROM friend WHERE uid2=me()) AND likes.user_likes=1 & LIMIT 5000

postings I've liked on events' walls:

????

postings I've liked on groups' walls:

????

Edit
Report

2 Answers

0

The problem is that the like table returns a blank post_id for everything. However, it does return an object_id for your likes.

You can put all these object_ids in a comma separated string, then submit a graph API call with ?ids=objectid1,objectid2,objectid3 etc.

This will then return all the objects that it finds. This way you can get the likes for stream items.

It seems to go about 4 weeks back. I can't seem to make it go any further back than this.

As an aside, one thing you will find is that liked comments are also returned as object_ids in the like table. However, there does not appear to be any way at all to find out the object details of these object_ids. Bit of mystery with these ones.

answered 2012-02-13T06:24:59.307
-1
SELECT post_id, actor_id, message, type, permalink, attachment, likes, 
    comments, description, updated_time, created_time
FROM stream 
WHERE filter_key in (
        SELECT filter_key 
        FROM stream_filter 
        WHERE uid=me() AND type='newsfeed'
)

just change type on your requirement

answered 2012-07-20T12:15:22.273

Your Answer