当前位置: 首页>>代码示例>>PHP>>正文


PHP Instagram::deleteSubscription方法代码示例

本文整理汇总了PHP中Instagram::deleteSubscription方法的典型用法代码示例。如果您正苦于以下问题:PHP Instagram::deleteSubscription方法的具体用法?PHP Instagram::deleteSubscription怎么用?PHP Instagram::deleteSubscription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Instagram的用法示例。


在下文中一共展示了Instagram::deleteSubscription方法的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);
}
开发者ID:Robo-romeski,项目名称:Instagram-PHP-API,代码行数:31,代码来源:subscription.php


注:本文中的Instagram::deleteSubscription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。