maztech/instagram-php-graph-sdk
Composer 安装命令:
composer require maztech/instagram-php-graph-sdk
包简介
Instagram SDK for PHP
README 文档
README
This repository contains the open source PHP SDK that allows you to access the Facebook Platform from your PHP app.
Disclamer: This SDK using Instagram Graph API and encourage to use "Instagram Basic Display API".
Requirement
- PHP >=5.4.1
- Guzzle 5.x
- PHPunit 4.x
- mockery 0.8
Installation
The preferred installation method is via composer. You can add the library as a dependency via:
$ composer require maztech/instagram-php-graph-sdk
Usage
<?php require_once __DIR__ . '/vendor/autoload.php'; // change path as needed $ig = new \Maztech\Instagram([ 'app_id' => '{app-id}', 'app_secret' => '{app-secret}' ]); // Use one of the helper classes to get a Instagram\Authentication\AccessToken entity. $helper = $ig->getRedirectLoginHelper(); // instagram login - https://api.instagram.com/oauth/authorize?app_id={$clientId}&redirect_uri={$redirecUri}&scope=user_profile,user_media&response_type=code $helper->getLoginUrl(); // get authorization url // instagram callback $helper->getAccessToken(); // get access token from code try { $queryParams = http_build_query([ 'access_token' => '{access-token}' ]); $response = $ig->get('/me?{$queryParams}'); } catch(\Instagram\Exceptions\InstagramResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(\Instagram\Exceptions\InstagramSDKException $e) { // When validation fails or other local issues echo 'Instagram SDK returned an error: ' . $e->getMessage(); exit; }
This SDK was referred at Facebook Developer site here
Copyright & License
PHP SDK for Instagram Graph API is Copyright (c) 2022 Mohd Azmin if not otherwise stated. The code is distributed under the terms of the MIT License.
maztech/instagram-php-graph-sdk 适用场景与选型建议
maztech/instagram-php-graph-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 716 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sdk」 「Instagram Basic Display API SDK」 「Instagram SDK」 「Instagram Graph API SDK」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 maztech/instagram-php-graph-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 maztech/instagram-php-graph-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 maztech/instagram-php-graph-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Handles basic OAuth/OAuth2 authentication along with classes for common services
Craft CMS plugin to receive Instagram feed data as variable in templates.
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
Laravel middleware to restrict a site or specific routes using HTTP basic authentication
An easy-to-use PHP Class for accessing Instagram's API.
redis log extension of yii2
统计信息
- 总下载量: 716
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-03-25