dulabs/instagram 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dulabs/instagram

Composer 安装命令:

composer require dulabs/instagram

包简介

Instagram OAuth 2.0 Client

README 文档

README

Wrapper for new Instagram API

Installation

Download branch master https://github.com/dulabs/new-instagram-api/archive/master.zip

See index.php to auth user with instagram.

See callback.php to get access token.

Login

require_once(__DIR__.'/../vendor/autoload.php');

use Dulabs\Instagram\OAuthManager as OAuth;

$config['api_key'] = "";
$config['api_secret'] = "";
$config['callback_url'] = "http://localhost/instagram/demo/callback.php";
$config['response_type'] = OAuth::RESPONSE_TYPE_CODE;

$oauth = new OAuth();

// initialiaze config
$oauth->setConfig($config);

// define scopes
$loginurl = $oauth->login(['basic','public_content','follower_list']);

header("location: ".$loginurl);

Callback

require_once(__DIR__.'/../vendor/autoload.php');

use Dulabs\Instagram\OAuthManager as OAuth;

$config['api_key'] = "";
$config['api_secret'] = "";
$config['callback_url'] = "http://localhost/instagram/callback.php";
$config['response_type'] = OAuth::RESPONSE_TYPE_CODE;

// We need to configure OAuth
$oauth = new OAuth();
$oauth->setConfig($config);

if(isset($_GET['code']) && !empty($_GET['code']))
{
	$token = $oauth->getAccessToken();
	setcookie("instagram_token",$token,time()+3600);
	header("location: demo.php");
}

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-04