开发者

how to return top shared links from facebook

开发者 https://www.devze.com 2023-02-27 01:21 出处:网络
I\'ve been searching about how to return list of top shared links of my website from facebook and i found the FQL http:开发者_高级运维//developers.facebook.com/docs/reference/fql/link_stat/

I've been searching about how to return list of top shared links of my website from facebook and i found the FQL http:开发者_高级运维//developers.facebook.com/docs/reference/fql/link_stat/ but when i dealed with it as normal sql tried to

SELECT share_count, like_count, comment_count, total_count,url 
  FROM link_stat 
  WHERE url like '%mysite.com/stories/%' 

I got the following error ... any ideas our work around to get a list with URLs and count

601 Parser error: unexpected 'like' at position 88

Thanks


They don't accept LIKE parameter


There is no like query in FQL

you can try

http://www.masteringapi.com/tutorials/facebook-fql-how-to-search-partial-strings-similar-to-mysql-like-operator/27/

You muse give exact link and can't use Like in FQL. You can test on https://developers.facebook.com/docs/reference/rest/fql.query/

SELECT share_count, like_count, comment_count, total_count FROM link_stat WHERE url='http://en.saturngod.net' OR url ='http://en.saturngod.net/mysql-cache-with-php-apc'


You need to do a full URL. I just ran this example:

https://api.facebook.com/method/fql.query?query=SELECT%20share_count,%20like_count,%20comment_count,%20total_count%20FROM%20link_stat%20WHERE%20url=%22http://eggie5.com%22&access_token=...

And got this:

<?xml version="1.0" encoding="UTF-8"?> 
<fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true"> 
  <link_stat> 
    <share_count>0</share_count> 
    <like_count>0</like_count> 
    <comment_count>0</comment_count> 
    <total_count>0</total_count> 
  </link_stat> 
</fql_query_response> 
0

精彩评论

暂无评论...
验证码 换一张
取 消