Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get all youtube videos that a user has liked on facebook

What I need, through the facebook API, is to get (for a specific, logged user) all the youtube videos (links to youtube pages) she liked on facebook, meaning all the posts she liked that contained a link to a youtube video.

I know I can do that in FQL with the url_like table, but I'd like to also have access to when the user liked the link (or at least when the link was posted), and more in general have access to the post it liked the video on.

For reference, this is the FQL documentation for that table (which does not serve the purpose): https://developers.facebook.com/docs/reference/fql/url_like/

like image 960
luca Avatar asked Oct 30 '12 00:10

luca


People also ask

How do you see what videos someone has liked on Facebook?

It's at the top of your friend's profile, but below their cover photo. A menu will expand with more options. Click Likes on the menu. This opens your friend's Likes page, where you'll find all of the movies, TV shows, artists, books, restaurants, and other Pages they've liked on Facebook.

How can I see what pictures My boyfriend likes on Facebook?

On the 'About' page, scroll down till you find a section' Likes. ' Then click on See All to see everything your boyfriend likes.

Can you search what someone has liked on Facebook?

Click the magnifying glass icon at the upper corner of your screen and enter the name of the Facebook user in the search bar. Choose the “About info” to be directed to the pages that they liked. In the likes section, you will see the pictures, videos and other content that the user liked. Click the “View all”.

How can I see the reacted posts on Facebook?

Tap in the top right of Facebook, then tap your name. Tap below your profile picture, then tap Activity Log. Tap Filter at the top of your activity log to review activities like: Things you've posted.


2 Answers

The call is very complex and I'm not really sure where to begin fixing the performance, maybe some batch calls, saving of data to post process... but the actual call itself using purely FQL takes a long time or chokes out on too big a query.

SELECT link_id, owner, created_time, title, summary, url, picture, image_urls 
FROM link 
WHERE url in 
    (SELECT url, user_id 
     FROM url_like 
     WHERE user_id=me()
     AND strpos(url, 'http://www.youtube.com/watch?v=') >= 0)
AND owner in (select uid2 from friend where uid1 = me() LIMIT 20)

Notice I imposed a limit of 20 friends.

like image 119
phwd Avatar answered Oct 10 '22 20:10

phwd


Can you not use:

{userId}/likes?fields=created_time.

For example, if I use "https://graph.facebook.com/me/likes?fields=created_time" it gives me my likes and the times I liked them.

Hope this helps.

like image 30
Neil Avatar answered Oct 10 '22 20:10

Neil