【问题标题】:Instagram error while trying to get followed by count尝试被计数跟踪时出现 Instagram 错误
【发布时间】:2018-03-14 13:59:57
【问题描述】:

我的网站在过去 5 个月内一直收到使用此脚本的 instagram 订阅:

<li class="instagram">
            <a target="_blank" href="<?php echo Yii::$app->config->getConstSite("LINK_PAGE_INSTAGRAM"); ?>">
                <i class="icon-instagram"></i>
                <?php if (!empty($followers_in)): ?>
                    <span class="quan"><?= number_format($followers_in["user"]["followed_by"]["count"]) ?></span>
                <?php endif; ?>
                <span>Followers</span>
            </a>
        </li>
    </ul>
</div>

昨天收到通知

未定义索引:用户

。我该如何解决这个问题?

【问题讨论】:

    标签: php instagram instagram-api notice


    【解决方案1】:

    随着 Instagram API 最近的变化,您可以使用以下代码获取关注者数量:

    <?= number_format($followers_in['graphql']['user']['edge_followed_by']['count']); ?>
    

    【讨论】:

    • 谢谢,Gustavo,它现在可以工作了。也许,您可以提供一些网络资源,我可以在哪里阅读有关 API 的这些最新变化?
    • 很高兴为您提供帮助!实际上,我也缺少这方面的信息,但我想请求的返回语法看起来很像 graphql API。有两个链接可以帮助您:Instagram ?__a=1 url doesn't allow max_idHow to use Instagram graphql?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-20
    • 2021-06-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多