Instagram粉丝数 [英] Instagram followers count

查看:168
本文介绍了Instagram粉丝数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,页面https://www.instagram.com/<username>/?__a=1返回403错误.还有另一种简单的方法来吸引帐户关注者吗?

For few days ago page https://www.instagram.com/<username>/?__a=1 returns 403 error. Is there another easy way to get account followers?

推荐答案

这是未记录的终结点之一,必须停止在某个点,因为它不应该公开访问.确实建议不要在应用程序中使用这些未记录的终结点,而应使用Instagram API.

This was one of the undocumented endpoints it has to be stopped at some point because it was not supposed to be accessible to public. It is really recommend to not to use these undocumented endpoints in your app instead use Instagram API.

但是,您可以使用此php解决方案来获取edge_followed_,但我尚未对其进行测试,但是您可以尝试:-

However You can get edge_followed_by using this php solution, I haven't tested it but you can try :-

$name = "{username}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.instagram.com/$name/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if($http=="200") {
  $doc = new DOMDocument();
  $doc->loadHTML($result);
  $xpath = new DOMXPath($doc);
  $js = $xpath->query('//body/script[@type="text/javascript"]')->item(0)->nodeValue;
  $start = strpos($js, '{');
  $end = strrpos($js, ';');
  $json = substr($js, $start, $end - $start);
  $data = json_decode($json, true);
  $user_id = $data["entry_data"]["ProfilePage"][0]["graphql"]["user"]["edge_followed_by"]["count"];
}  

这篇关于Instagram粉丝数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆