2013-07-08 33 views
0

我有一個instagram分頁的問題。我需要媒體/喜歡的代碼。 我試過用$ jsonurl =「https://api.instagram.com/v1/useers/self/media/liked?access_token='」。$ data-> access_token。「'& count = 2」但是不返回任何東西。 Thx提前!我可以修復Instagram分頁gow

<?php 
session_start(); 
$data=$_SESSION['userdetails']; 
echo $data->access_token; 
if (isset($_REQUEST['next']) && isset($_SESSION['next'])) 
$jsonurl = $_SESSION['next']; 
else 
$jsonurl = "https://api.instagram.com/v1/useers/self/media/liked?access_token='".$data- >access_token."'&count=2"; 
$json = file_get_contents($jsonurl,0,null,null); 
$response = json_decode($json, true); 

$_SESSION['next'] = $response['pagination']['next_url']; 
?> 
<div class="photo"> 
<a href="<?= $link ?>"><span></span><img src="<?= $thumbnail ?>" title="<?= $text ?>" alt="<?= $text ?>" /></a> 
    <div class="metaz">via <?= $author ?> at <?echo date("h:i:s A 
\o\\n d/m/Y",$date);?></div> 
    <?= $text ?> 

// Button code here: 
<a href="?next">next</a> 

回答

0

您在URL中的拼寫錯誤:/useers/必須/users/

$jsonurl = "https://api.instagram.com/v1/useers/self/media/liked?access_token='".$data->access_token."'&count=2";

需要是:

$jsonurl = "https://api.instagram.com/v1/users/self/media/liked?access_token='".$data->access_token."'&count=2";

+0

我試過,但沒有結果。 –

+0

此外''>'需要附加' - >' – SeanWM

+0

是的,請忽略 - >和用戶 –

相關問題