即使url中的fql本身有效,file

编程入门 行业动态 更新时间:2024-10-28 19:22:05
即使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_insights

Does anyone know anything?

最满意答案

我终于自己解决了。

attachment.caption in xxxx

无论在网址栏中输入查询时它是否有效,都是没有结果的原因。

I finally solved it by myself.

attachment.caption in xxxx

was the cause of no results regardless of that it works when you type query in url bar.

更多推荐

本文发布于:2023-07-14 23:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1108391.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:url   fql   file

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!