czpechy / instagramprofilecrawler
获取Instagram个人资料最新消息的方法
v1.0.1
2022-07-06 08:54 UTC
Requires
- php: >=5.6.0
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2024-09-06 14:11:37 UTC
README
instagramProfileCrawler
- 无需API即可从Instagram个人资料获取最新媒体
这是一个仅限HTML爬虫(从Instagram页面获取json数据)- 如果Instagram进行了某些更改,请发送问题
- 如果您需要更多数据,请发送问题或MR
使用composer安装
$ composer require czpechy/instagramprofilecrawler
如何使用
include_once __DIR__ . '/../vendor/autoload.php'; $client = new \czPechy\instagramProfileCrawler\Client('angelinajolie'); /** @var \czPechy\instagramProfileCrawler\Profile $profile */ $profile = $client->getProfile(); var_dump($profile->toArray());
array( 'id' => "45276652", 'username' => "angelinajolie", 'fullName' => "Angelina Jolie", 'biography' => "People will always...", 'followers' => 8848810, 'isPrivate' => false, 'isVerified' => false, 'profilePictureHD' => "https://scontent-frx5-1.cdninstagram.com/vp/031765b0e647064c7aaad4c26067280e/5BF14069/t51.2885-19/11356833_110581152627368_512723102_a.jpg", 'profilePicture' => "https://scontent-frx5-1.cdninstagram.com/vp/031765b0e647064c7aaad4c26067280e/5BF14069/t51.2885-19/11356833_110581152627368_512723102_a.jpg", 'facebookPage' => NULL, );
/** @var \czPechy\instagramProfileCrawler\Media\IItem $media */ foreach($profile->getMedia() as $media) { // interface \czPechy\instagramProfileCrawler\Media\IItem // // \czPechy\instagramProfileCrawler\Media\Photo // OR // \czPechy\instagramProfileCrawler\Media\Video var_dump($media->toArray()); }
array( 'shortCode' => "BloCixPBqoj", 'link' => "https://www.instagram.com/p/BloCixPBqoj/", 'photo' => "https://scontent-frx5-1.cdninstagram.com/vp/d60a0d3bdedeb0253db83decfcbd38ab/5BF1A297/t51.2885-15/e35/37002718_285078285574435_8958765677343145984_n.jpg", 'likes' => 113196, 'comments' => 788, 'thumbnail' => "https://scontent-frx5-1.cdninstagram.com/vp/b9bc9f7c30afde1a7b567a504062a6e5/5C0270C2/t51.2885-15/sh0.08/e35/c0.120.961.961/s640x640/37002718_285078285574435_8958765677343145984_n.jpg", 'text' => "❤❤" );
请我喝杯咖啡 <3
或者给我一些加密货币 ¯\_(ツ)_/¯
ETH: 0x7D771A56735500f76af15F589155BDC91613D4aB
UBQ: 0xAC08C7B9F06EFb42a603d7222c359e0fF54e0a13