gpt4 book ai didi

php - 使用 PHP 获取 FQL 数据

转载 作者:行者123 更新时间:2023-12-02 07:47:44 24 4
gpt4 key购买 nike

*更新数据正在返回但未输出到浏览器。当我在下面的答案中使用 urlencode 建议后,当我查看源代码时,它就在那里。**

用这个把我的头发拉出来。

基于以下链接:

facebook FQL overview

FQL Video table info

这段代码应该可以提取我需要的表格数据:

ini_set("display_errors","2");
ERROR_REPORTING(E_ALL);

$contents = file_get_contents('https://api.facebook.com/method/fql.query?query=SELECT vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner= *******myID****');

echo $contents;

但是我收到以下错误:

Warning: file_get_contents(https://api.facebook.com/method/fql.query?query=SELECT  vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner= ******myID*****) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /vservers/mywebsite/htdocs/test.php on line 5

谁能看出我做错了什么?

最佳答案

尝试将主线更改为:

$enc = urlencode('SELECT vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner= *******myID****');
$contents = file_get_contents("https://api.facebook.com/method/fql.query?query=$enc");

关于php - 使用 PHP 获取 FQL 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5767777/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com