【问题标题】:Get Last Post instagram of public_users获取 public_users 的最新帖子 instagram
【发布时间】:2018-05-13 22:31:05
【问题描述】:

我有一个用 PHP 编写的网站。我问是否可以在我的网站上自动显示 Instagram 上的最新公开帖子?谁会打开网站查看帖子?无需输入 Instagram 帐户

如果可能的话,请给我指导,以便我寻找它的培训

示例:

【问题讨论】:

    标签: php html api instagram


    【解决方案1】:

    你可以使用这个库:

    https://github.com/cosenary/Instagram-PHP-API

    调用示例:

    1. 安装:

      $ composer require cosenary/instagram
      
    2. 初始化类:

      use MetzWeb\Instagram\Instagram;
      
      $instagram = new Instagram(array(
          'apiKey'      => 'YOUR_APP_KEY',
          'apiSecret'   => 'YOUR_APP_SECRET',
          'apiCallback' => 'YOUR_APP_CALLBACK'
      ));
      
      echo "<a href='{$instagram->getLoginUrl()}'>Login with Instagram</a>";
      
    3. 数据:

      $result = $instagram->getUserMedia();
      

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多