【问题标题】:Instagram followers are not showing?Instagram 追随者没有显示?
【发布时间】:2017-10-11 20:19:56
【问题描述】:

我正在使用此代码来统计关注者!

<?php
    $api_key = '------';
    $user_id = '------';
    $data = @file_get_contents("https://api.instagram.com/v1/users/$user_id/?client_id=$api_key");
    $data = json_decode($data, true);
    echo '<pre/>';
    print_r($data);
    echo $data['data']['counts']['followed_by'];
    ?>

【问题讨论】:

  • 有输出吗?删除 file_get_contents 之前的 @ 会发生什么?
  • 显示你的输出
  • 删除您的 api 密钥和用户 ID。否则您将在几分钟内发布垃圾邮件。
  • 显示空白框

标签: php laravel-5 instagram-api


【解决方案1】:

失败是因为您无法使用客户端 ID 访问 API 的该功能。

您需要通过将用户发送到授权网址来获得Access Token。在Instagram Docs 中了解它。

之后,您使用之前的Access Token/users 发出请求。

【讨论】:

    猜你喜欢
    • 2018-07-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-03
    • 1970-01-01
    • 1970-01-01
    • 2023-03-06
    相关资源
    最近更新 更多