本文整理匯總了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);
}