ufxdcollective / instagram-scraper
Scrap Instagram Public Profile
0.2.0
2019-12-18 09:07 UTC
Requires
- php: 7.*
- ext-json: *
- guzzlehttp/guzzle: ^6.5
This package is auto-updated.
Last update: 2024-05-18 19:38:58 UTC
README
Usage
use UFXDCollective\InstagramScraper\Scraper;
$cache_dir = __DIR__ . '/cache';
$cache_timeout = 60 * 60 * 24; // 1 day in seconds
$scraper = new Scraper($cache_dir);
// Enable Cache.
$scraper->enableCache($cache_dir, $cache_timeout);
// Get the latest post.
$data = $scraper->latestPost();
// Structure of the $data variable will be:
$data = [
'image' => 'url/of/image/',
'cached_image' => 'cached_filename',
'caption' => 'Image Caption',
];