Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t使用PHP刷新Facebook共享URL_Php_Facebook - Fatal编程技术网

Can';t使用PHP刷新Facebook共享URL

Can';t使用PHP刷新Facebook共享URL,php,facebook,Php,Facebook,我有一个链接要共享,当我更新链接参数时,Facebook的缓存不会更新 我可以通过以下链接手动更新: 简单地说,我的代码无法做到这一点: $graph = 'https://graph.facebook.com/'; $post = 'id=' . urlencode("http://fbooo.byethost4.com/committees/6") . '&scrape=true'; send_post($graph, $post); function send_post($url

我有一个链接要共享,当我更新链接参数时,Facebook的缓存不会更新

我可以通过以下链接手动更新:

简单地说,我的代码无法做到这一点:

$graph = 'https://graph.facebook.com/';
$post  = 'id=' . urlencode("http://fbooo.byethost4.com/committees/6") . '&scrape=true';
send_post($graph, $post);
function send_post($url, $post)
{
    $r = curl_init();
    curl_setopt($r, CURLOPT_URL, $url);
    curl_setopt($r, CURLOPT_POST, 1);
    curl_setopt($r, CURLOPT_POSTFIELDS, $post);
    curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($r, CURLOPT_CONNECTTIMEOUT, 5);
    $data = curl_exec($r);
    curl_close($r);
    return $data;
}

我没有发现任何错误。我缺少什么?

我会尝试将
$post
作为数组传递。另外,我会将整个链接构造为URL,并尝试使用以下内容发出GET请求:
https://graph.facebook.com/?id=OBJECT_URL&scrape=true&method=post
我会尝试将
$post
作为数组传递。另外,我会将整个链接构造为URL,并尝试使用以下内容发出GET请求:
https://graph.facebook.com/?id=OBJECT_URL&scrape=true&method=post