【问题标题】:Instagram photo displayInstagram照片展示
【发布时间】:2016-06-13 16:49:27
【问题描述】:

我一直在我的网站上使用此代码作为 instagram 提要,但突然它不再工作了,我创建了一个新的 id 和 accesstoken,但这些也不起作用。

<?php
    // Supply a user id and an access token
    $userid = "******";
    $accessToken = "*******";

    // Gets our data
    function fetchData($url){
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_TIMEOUT, 20);
         $result = curl_exec($ch);
         curl_close($ch); 
         return $result;
    }

    // Pulls and parses data.
    $result = fetchData("https://api.instagram.com/v1/users/{$userid}   /media/recent/?access_token={$accessToken}");
    $result = json_decode($result);
?>


    <?php foreach ($result->data as $post): ?>
    <!-- Renders images. @Options (thumbnail,low_resoulution,   high_resolution) -->
    <a class="group" rel="group1" href="<?= $post->images->standard_resolution->url ?>"><img src="<?= $post->images->thumbnail->url ?>"></a>
<?php endforeach ?>

【问题讨论】:

    标签: php instagram


    【解决方案1】:

    Instagram 更新了他们的服务条款。他们现在需要审核每个申请。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-22
      • 2018-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多