Can';t使用PHP刷新Facebook共享URL
我有一个链接要共享,当我更新链接参数时,Facebook的缓存不会更新 我可以通过以下链接手动更新: 简单地说,我的代码无法做到这一点: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
$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