public function feed()
 {
     Phalanx::loadClasses('SocialNetwork');
     $token = SocialNetwork::get_access_token(1, INSTAGRAM);
     $token = json_decode($token);
     $instagram = new Instagram($this->config);
     $instagram->setAccessToken($token->access_token);
     $popular = $instagram->getUserFeed();
     $response = json_decode($popular, true);
     foreach ($response['data'] as $each) {
         echo "<img src='{$each['images']['thumbnail']['url']}'>";
     }
 }
<?php

session_start();
require 'instagram.class.php';
// Setup class
$instagram = new Instagram(array('apiKey' => '', 'apiSecret' => '', 'apiCallback' => ''));
// Receive OAuth code parameter
$data = $_SESSION[$token];
//echo $data."\n\n";
// $data = $instagram->getOAuthToken($code);
$instagram->setAccessToken($data);
//echo "$code<br>";
//echo strlen($code);
//echo "$code<br>";
// Check whether the user has granted access
$id = $_POST['Tid'];
$insta = $instagram->getUserFeed();
//echo "<br>instagram-------------------------------------------------------------------------------------------------------------------------------------------------------------<br>";
echo json_encode($insta->data);
Beispiel #3
0
<?php

session_start();
if (!isset($_SESSION['AccessToken'])) {
    header('Location: redirect.php?op=getauth');
    die;
}
require_once 'Class.Instagram.php';
$instgram = new Instagram();
$userfeed = json_decode($instgram->getUserFeed(20));
include_once 'header.php';
include_once 'leftmenu.php';
?>

<div id="content">
<div id="content_top"></div>
<div id="content_main">
<?php 
foreach ($userfeed->data as $feeddata) {
    ?>

        <h2>&nbsp; </h2>
        <p>&nbsp;</p>
       	<h3><img src="<?php 
    echo $feeddata->user->profile_picture;
    ?>
" width="60" height="60" caption="Profile Image">&nbsp;&nbsp;<?php 
    echo $feeddata->user->username;
    ?>
 </h3>
       	<br><img src="<?php