【问题标题】:Instagramm API PHP Follow UserInstagram API PHP 关注用户
【发布时间】:2015-09-27 06:02:55
【问题描述】:

目前我尝试在网站中实现 Instagramm API。 哪个能够获取访问令牌然后关注用户。

我在 Google 上搜索过,但找不到有用的 PHP 代码示例?

我发现的只有这个 https://github.com/cosenary/Instagram-PHP-API


现在我在这里编码了这个

   error_reporting(E_ALL);
ini_set("display_errors", 1);
require 'inc/Instagram.php';
require 'inc/InstagramException.php';

use MetzWeb\Instagram\Instagram;

$instagram = new Instagram(array(
    'apiKey'      => 'APIKEY',
    'apiSecret'   => 'SECRET',
    'apiCallback' => 'CALLBACK'
));


if (isset($_GET['code'])) {
// grab OAuth callback code
$code = $_GET['code'];
$data = $instagram->getOAuthToken($code);

echo 'Your username is: ' . $data->user->username;  

$token= $data->access_token;
$instagram->setAccessToken($token);
echo $instagram->getAccessToken();
try {

$instagram->modifyRelationship('follow', 1399448929);

} catch (Exception $e) {
    echo 'Exception abgefangen: ',  $e->getMessage(), "\n";
}

}else {

        $urli= $instagram->getLoginUrl(array(
    'basic',
    'relationships',
    'likes'
));


    echo "<a href=".$urli.">Login with Instagram</a>";

}

但它不起作用... 没有错误消息或其他内容,但它没有跟随用户。

所以现在我的问题:

有人知道为什么吗? ... 或者有谁知道让这个工作的正确方法?

请提供链接和代码示例。

那是葡萄
谢谢!!!

【问题讨论】:

    标签: php api github instagram


    【解决方案1】:

    您可以关注instagramm API 的网址。我将其用于 Instagram 登录及其对我的工作

    但您也可以检查是否关注用户和关系,但我认为它也适用于您。

    【讨论】:

      猜你喜欢
      • 2014-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多