我有代码显示我的粉丝数在页面上,但我认为本周 instagram 更新了网站,使用 curl 时不再在个人资料中显示粉丝数
这是我以前工作过的代码:
$ch = curl_init();
$url = 'https://www.instagram.com/example';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Googlebot/2.1 (http://www.googlebot.com/bot.html)');
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
//curl_setopt($ch, CURLOPT_TIMEOUT, 1); // Removed
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Added
$data = curl_exec($ch);
preg_match('/<meta content="([0-9]+).*Followers/',$data,$result);
echo $result[1];
这是为什么缺少关注者计数器的视图源:
http://pasted.co/ad3dc7d2
我无法在此处发布观看分数,因为此处限制为 30.000 个字符
慕哥6287543