即使url中的fql本身有效,file_get_contents()也不会返回FQL结果(file_get_contents() doesn't return FQL results even if the fql itself in url works)
在url栏中输入此查询,它可以正常工作。 我可以在浏览器窗口中获得结果。
https://graph.facebook.com/fql?q=SELECT+actor_id+FROM+stream+WHERE+post_id+IN+(SELECT+post_id+FROM+stream+WHERE+filter_key+in+(SELECT+filter_key+FROM+stream_filter+WHERE+uid=me()+AND+name='Links')+AND+attachment.caption+in+('xxxx.com','xxxx.com')+AND+type=80+AND+created_time%3C=now()+LIMIT+20)+ORDER+BY+created_time+DESC+&access_token=xxxx...但下面的PHP代码没有。 file_get_contents()返回空数组。
$fql_query_url = 'https://graph.facebook.com/' . 'fql?q=' . str_replace(' ', '+', $query1) . '&access_token=' . $access_token; $fql_query_result = file_get_contents($fql_query_url);上面提到的查询是$ fql_query_url的转储。
应用程序已获得以下权限。
read_stream read_insights有谁知道吗?
Type this query in url bar, it works. I can get the results on the browser window.
https://graph.facebook.com/fql?q=SELECT+actor_id+FROM+stream+WHERE+post_id+IN+(SELECT+post_id+FROM+stream+WHERE+filter_key+in+(SELECT+filter_key+FROM+stream_filter+WHERE+uid=me()+AND+name='Links')+AND+attachment.caption+in+('xxxx.com','xxxx.com')+AND+type=80+AND+created_time%3C=now()+LIMIT+20)+ORDER+BY+created_time+DESC+&access_token=xxxx...But php code below doesn't. file_get_contents() returns empty array.
$fql_query_url = 'https://graph.facebook.com/' . 'fql?q=' . str_replace(' ', '+', $query1) . '&access_token=' . $access_token; $fql_query_result = file_get_contents($fql_query_url);The query mentioned above is dump of $fql_query_url.
App already has got permissions below.
read_stream read_insightsDoes anyone know anything?
最满意答案
我终于自己解决了。
attachment.caption in xxxx无论在网址栏中输入查询时它是否有效,都是没有结果的原因。
I finally solved it by myself.
attachment.caption in xxxxwas the cause of no results regardless of that it works when you type query in url bar.
更多推荐
发布评论