更新时间:2022-11-23 21:24:35
您可以使用Facebook图形API使用 PHP-cURL
调试图形对象,方法是执行 POST
to
You can debug a graph object using Facebook graph API with PHP-cURL
, by doing a POST
to
https://graph.facebook.com/v1.0/?id={Object_URL}&scrape=1
使事情更容易,我们可以将调试器包装在一个函数中:
to make thing easier, we can wrap our debugger within a function:
function facebookDebugger($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/v1.0/?id='. urlencode($url). '&scrape=1');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$r = curl_exec($ch);
return $r;
}
虽然这会更新&清除通过的 URL
的Facebook缓存,打印出每个密钥&其内容并避免错误的同时,但是我建议使用 var_dump()
或 print_r()
OR PHP-ref
though this will update & clear Facebook cache for the passed URL
, it's a bit hard to print out each key & its content and avoid errors in the same time, however I recommended using var_dump()
or print_r()
OR PHP-ref
使用与 PHP-ref
r( facebookDebugger('http://retrogramexplore.tumblr.com/') );