downace/instagram-php-scraper

此包已被弃用且不再维护。作者建议使用 raiym/instagram-php-scraper 包。

Instagram PHP Scraper。无需任何授权即可获取账户信息、照片和视频

v1.0.0-RC1 2018-06-24 06:28 UTC

README

此包已被弃用。请使用原始的 postaddictme/instagram-php-scraper

这是 postaddictme/instagram-php-scraper 仓库的分支。原描述

这个库基于Instagram网页版。我们开发它是因为现在很难获得Instagram应用的批准。目的是支持网页桌面和移动版本支持的所有功能。

分支信息

此分支提供了指定自定义HTTP客户端来处理请求的能力。包括 guzzlehttp/guzzlemashape/unirest-php 客户端。

此外,已从 Instagram 类中删除代理方法:代理应配置为HTTP客户端(遵循分离关注点原则)

安装

使用composer

composer require downace/instagram-php-scraper

如果您没有composer

您可以从这里下载它 这里

示例

您可以在这里看到原始库的使用示例。

使用Unirest(需要 mashape/unirest-php

$insta = new Instagram(new \InstagramScraper\HttpClient\UnirestClient());

使用Guzzle(需要 guzzlehttp/guzzle

// \GuzzleHttp\Client with default options will be used
$insta = new Instagram(new \InstagramScraper\HttpClient\GuzzleClient());

// You can provide options for \GuzzleHttp\Client constructor
$insta = new Instagram(new \InstagramScraper\HttpClient\GuzzleClient([ 'timeout' => 5 ]));

// Or pass your own instance of \GuzzleHttp\ClientInterface:
$insta = new Instagram(new \InstagramScraper\HttpClient\GuzzleClient($myClient));

使用代理

// With Guzzle.
$insta = new Instagram(new \InstagramScraper\HttpClient\GuzzleClient([
    'proxy' => 'http://user:pass@localhost:8125'
]));

// With Unirest
Request::proxy('localhost', 8125, CURLPROXY_HTTP);
Request::proxyAuth('user', 'pass');
$insta = new Instagram(new \InstagramScraper\HttpClient\UnirestClient());