firusvictor/instagramapi
Composer 安装命令:
composer require firusvictor/instagramapi
包简介
An easy-to-use PHP Class for accessing Instagram's API.
关键字:
README 文档
README
- Installation
- Example
- Method Api
- Use Proxy
Installation
Using Composer:
composer require firusvictor/instagramapi
Example
require_once __DIR__ . '/vendor/autoload.php'; use InstaLite; $instagram = new InstaLite("username", "password", "proxy"); /** search user (return array standart instagram) **/ $user = $instagram->searchUser('alex')->id(); /** check #tag on user wall **/ $is_tag = $instagram->isHashtagByName('alex', 'tag')->all(); /** check user subscription on this server profile **/ $is_tag = $instagram->isSubscriptionByName('alex')->all(); /** send photo **/ $instagram->uploadPhoto(__DIR__ . '/img.jpg', 'text #hashtag'); /** send message direct **/ $instagram->sendMessage('text message', [1233, 1233, 1223]);
Method
Search User
Search user instagram, nickname, username, last name, first name
$key = "search first name or username ..."; $user = $instagram->searchUser($key); $user->id(); /** return array user id **/ [1, 2, 3, 4, 5, 6] $user->all(); /** return array user standart formate instagram **/ [ [ pk: "" username: "" full_name: "" is_private: false profile_pic_url: "" profile_pic_id: "" is_verified: false has_anonymous_profile_picture: false mutual_followers_count: 0 social_context: "" search_social_context: "" friendship_status: {} latest_reel_media: 1580484486 seen: 0 ],[],[] ]
Upload Photo
Send photo, upload instagram
/** file photo mimetype JPEG **/ $photo = __DIR__ . '/image.jpg'; /** Message text and Hashtag **/ $message = 'Hello InstaGram'; $upload = $instagram->uploadPhoto($photo, $message); /** Result **/ if($upload) { /** upload photo sussecc **/ echo $upload; /** media id **/ }
Send Message
Send message direct instagram
/** Array user id **/ $user = [12356456, 45645465]; /** Message text **/ $message = 'Hello InstaGram'; $send = $instagram->sendMessage($message, $user); /** Result **/ if($send) { /** message send sussecc **/ }
Use Proxy
supports socks5 and http/https
/** socks5 **/ $instagram = new InstaLite("username", "password", "socks5://login:password@ip:port"); /** http/https **/ $instagram = new InstaLite("username", "password", "http://login:password@ip:port");
firusvictor/instagramapi 适用场景与选型建议
firusvictor/instagramapi 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 08 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「web」 「instagram」 「insta」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 firusvictor/instagramapi 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 firusvictor/instagramapi 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 firusvictor/instagramapi 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Model of a web-based resource
A PSR-7 compatible library for making CRUD API endpoints
Retrieve a WebResourceInterface instance over HTTP
Selectize Theme for Bootstrap 4
Provides command to manage a web library directory
Alfabank REST API integration
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-12