本文整理汇总了PHP中Instagram::getUserFeed方法的典型用法代码示例。如果您正苦于以下问题:PHP Instagram::getUserFeed方法的具体用法?PHP Instagram::getUserFeed怎么用?PHP Instagram::getUserFeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Instagram
的用法示例。
在下文中一共展示了Instagram::getUserFeed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: feed
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']}'>";
}
}
示例2: json_encode
<?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);
示例3: header
<?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> </h2>
<p> </p>
<h3><img src="<?php
echo $feeddata->user->profile_picture;
?>
" width="60" height="60" caption="Profile Image"> <?php
echo $feeddata->user->username;
?>
</h3>
<br><img src="<?php