Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用用户名/用户id获取Instagram订阅源_Php_Codeigniter_Instagram_Instagram Api - Fatal编程技术网

Php 使用用户名/用户id获取Instagram订阅源

Php 使用用户名/用户id获取Instagram订阅源,php,codeigniter,instagram,instagram-api,Php,Codeigniter,Instagram,Instagram Api,早些时候我用过 从这个月开始,由于instagram改变了api,我无法获得订阅源。 任何建议都会很有帮助请按照我的步骤操作 首先,您需要在Instagram开发者网站上注册您的应用程序,并获取您的客户ID&客户机密代码,然后您必须使用客户ID&客户机密 访问此处:用于创建客户端ID,客户端机密&访问\u令牌 然后,在控制器函数中添加以下代码 $access_token = 'xxxxxxxxxx.xxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // yo

早些时候我用过

从这个月开始,由于instagram改变了api,我无法获得订阅源。 任何建议都会很有帮助

请按照我的步骤操作

首先,您需要在Instagram开发者网站上注册您的应用程序,并获取您的
客户ID
&
客户机密
代码,然后您必须使用
客户ID
&
客户机密

访问此处:用于创建
客户端ID
客户端机密
&
访问\u令牌

然后,在控制器函数中添加以下代码

$access_token = 'xxxxxxxxxx.xxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // your access_token will be this format
$count_feed = 2; // how many feed want to load

$requestURL = 'https://api.instagram.com/v1/users/self/media/recent?access_token='.$access_token.'&count='.$count_feed;
$ch = curl_init();
curl_setopt_array($ch, array(        
    CURLOPT_URL => $requestURL,
    CURLOPT_HEADER  => false,
    CURLOPT_RETURNTRANSFER => 1
));
$json_response = curl_exec($ch);
curl_close($ch);
$insta_feeds = json_decode($json_response, true);

_e($insta_feeds); // $insta_feeds['data'] will return feed

您可以使用Instagram库获取提要。请在此处查看库:

您是否能够解决此问题?我们也有同样的问题。