The package for those who hate Instagram's official API! (Or for those who just can't get a hold of an access token...)
Thanks to the fact that this package is dependent on Instagram not changing their page source for user profiles, it may break at any time.
To use this package you need to have cURL enabled and your Laravel project needs to be version 5 or up.
First require the package
composer require "dw/instacrawl:v0.10.0-alpha"
Then add the service provider
DW\InstaCrawl\ServiceProvider::class,
And the facade
'InstaCrawl' => DW\InstaCrawl\Facade::class,
The configuration defines where the JSON data begins and ends on the crawled Instagram data. Also defines which keys contains the needed data for functions, ex: followed_by. If this package stops working, check the page source of a random Instagram user's profile and look for JSON and see if it differs.
To change the configuration, just run
php artisan vendor:publish --provider="DW\InstaCrawl\ServiceProvider" --tag=config
All functions returns a string, do whatever you want with it.
/**
* Takes a username and retrieves the amount of followers for said user.
*
* returns string
*/
InstaCrawl::getAmountOfFollowers('blondinbella');
/**
* Takes a username and retrieves the amount of people said user follows.
*
* returns string
*/
InstaCrawl::getAmountOfFollows('blondinbella');
/**
* Takes a username and retrieves the amount of posts from said user.
*
* returns string
*/
InstaCrawl::getAmountOfPosts('blondinbella');
/**
* Takes a username and retrieves said user's biography.
*
* returns string
*/
InstaCrawl::getBiography('blondinbella');
/**
* Takes a username and retrieves the full name specified by said user.
*
* returns string
*/
InstaCrawl::getFullName('blondinbella');
/**
* Takes a username and retrieves said user's id.
*
* returns string
*/
InstaCrawl::getId('blondinbella');
/**
* Takes an url for a user's profile and extracts the username.
*
* returns string
*/
InstaCrawl::getUsernameFromUrl('https://www.instagram.com/blondinbella/');
/**
* Takes a username and retrieves said user's most recent media.
*
* returns array
*/
InstaCrawl::getRecentMedia('blondinbella');