Skip to content

Instantly share code, notes, and snippets.

@stephanebruckert
Last active August 29, 2015 14:12
Show Gist options
  • Save stephanebruckert/c97773cf2ffbc6f53648 to your computer and use it in GitHub Desktop.
Save stephanebruckert/c97773cf2ffbc6f53648 to your computer and use it in GitHub Desktop.
Get like, share and comment count from Facebook post link (FQL request) http://stackoverflow.com/q/19061937/1515819
SELECT like_info.like_count, comment_info.comment_count, share_count
FROM stream
WHERE post_id IN (
SELECT concat(id,'_', substr("https://www.facebook.com/Macklemore/posts/10153256675935268", strpos("https://www.facebook.com/Macklemore/posts/10153256675935268", '/posts')+7, strlen("https://www.facebook.com/Macklemore/posts/10153256675935268")))
FROM profile WHERE username IN (
SELECT substr(url, strpos(url, 'facebook.com/')+13, strpos(url, '/posts')-strpos(url, 'facebook.com/')-13)
FROM object_url
WHERE url = "https://www.facebook.com/Macklemore/posts/10153256675935268"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment