本文整理汇总了PHP中Instagram::listSubscriptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Instagram::listSubscriptions方法的具体用法?PHP Instagram::listSubscriptions怎么用?PHP Instagram::listSubscriptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Instagram
的用法示例。
在下文中一共展示了Instagram::listSubscriptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
require_once 'Instagram.php';
/**
* Configuration params, make sure to write exactly the ones
* instagram provide you at http://instagr.am/developer/
*/
$config = array('client_id' => 'e8d6b06f7550461e897b45b02d84c23e', 'client_secret' => '2357fc69da344800acef2592ef647491', 'grant_type' => 'authorization_code', 'redirect_uri' => 'http://mauriciocuenca.com/qnktwit/');
/**
* This is how a wrong response looks like
* array(1) { ["InstagramOAuthToken"]=> string(89) "{"code": 400, "error_type": "OAuthException", "error_message": "No matching code found."}" }
*/
session_start();
if (isset($_SESSION['InstagramAccessToken']) && !empty($_SESSION['InstagramAccessToken'])) {
header('Location: callback.php');
die;
}
// Instantiate the API handler object
$instagram = new Instagram($config);
//Setup subscription
if (isset($rs[0]["access_token"])) {
$instagram->setAccessToken($_SESSION['InstagramAccessToken']);
if (isset($_GET['list'])) {
$subscriptions = $instagram->listSubscriptions();
} else {
if (isset($_GET['delete'])) {
$subscriptions = $instagram->deleteSubscription(array("object" => "all"));
} else {
$subscriptions = $instagram->createSubscription(array("object" => "tag", "object_id" => "mydowntown", "aspect" => "media", "callback_url" => $config['instagram']['redirect_uri'] . "subscriptions.php"));
}
}
print_r($subscriptions);
}