julionc/instagram
Composer 安装命令:
composer require julionc/instagram
包简介
A PHP library for the Instagram API
关键字:
README 文档
README
A PHP library for the Instagram API
Table of Contents
Installation
Using composer:
{
"require": {
"julionc/instagram": "dev-master"
}
}
How to Use
require_once('vendor/autoload.php'); $config = array( 'client_id' => 'YOUR_CLIENT_ID', 'client_secret' => 'YOUR_CLIENT_SECRET', 'redirect_uri' => 'CALLBACK_URL', 'scope' => array('basic') ); $client = new Instagram\Auth($config); // In view, get the Authorize URL $client->authorize_url();
// profile.php // Preload the settings and capture the access code (Callback step). if (!$access_token) { $client = new Instagram\Auth($config); $client->requestAccessToken($access_code); $_SESSION['access_token'] = $client->getAccessToken(); } $instagram = new \Instagram\Instagram($access_token, 'secret_key_here');
If you do not wish to put your client credentials in your code (understandable), simply set it to the environment variable instagram.client_id and instagram.client_secrect.
So php-instagram will automatically pick it up.
See example folder.
EndPoints
User
$instagram = new \Instagram\Instagram($access_token); // Get basic information about a user. $user = $instagram->user->info(); // See the authenticated user's feed. $feed = $instagram->user->feed(); // Get the most recent media published by a user. $media = $instagram->user->media();
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-12