2016-06-12 10 views
0

Ich habe diesen Code auf meiner Website für einen Instagram-Feed verwendet und plötzlich funktioniert es nicht mehr, ich habe eine neue ID und AccessStoken erstellt, aber diese funktionieren auch nicht.Instagram Foto-Display

<?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 ?> 

Antwort

0

Instagram hat ihre TOS aktualisiert. Jede Anwendung muss jetzt von ihnen überprüft werden.