如何从Facebook返回顶级共享链接

时间:2011-04-18 20:51:42

标签: sql facebook facebook-fql

我一直在搜索如何从facebook返回我的网站顶级共享链接列表,我找到了FQL http://developers.facebook.com/docs/reference/fql/link_stat/ 但是当我按照正常的sql试图用它处理时

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

我收到以下错误...我们正在努力获取包含网址和计数的列表

601 Parser error: unexpected 'like' at position 88

谢谢

3 个答案:

答案 0 :(得分:1)

他们不接受LIKE参数

答案 1 :(得分:1)

FQL中没有类似的查询

你可以尝试

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

你冥想给出确切的链接,不能在FQL中使用Like。您可以在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'

答案 2 :(得分:0)

您需要填写完整的网址。我刚刚运行了这个例子:

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= ...

得到了这个:

<?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>