codfee / instagram
An easy-to-use instagram tags,users,likes,posts and simple Instagram api package
Requires
- php: ^7.0
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.2
- php-http/httplug: ^1.1
- php-http/message-factory: ^1.0
Requires (Dev)
- php-http/guzzle6-adapter: ^1.1
- php-http/message: ^1.5
- php-http/mock-client: ^1.0
- phpunit/phpunit: ^6.4
This package is not auto-updated.
Last update: 2025-01-26 15:15:34 UTC
README
An easy-to-use and simple Instagram package.
use CodFee\Instagram\Instagram; // Create a new instagram instance. $instagram = new Instagram('your-access-token'); // Fetch the user's recent media feed. $instagram->get();
Installation
Instagram is decoupled from any library sending HTTP requests (like Guzzle), instead it uses an abstraction called HTTPlug which provides the http layer used to send requests to exchange rate services. This gives you the flexibility to choose what HTTP client and PSR-7 implementation you want to use.
Read more about the benefits of this and about what different HTTP clients you may use in the HTTPlug documentation. Below is an example using Guzzle 6:
$ composer require codfee/instagram php-http/message php-http/guzzle6-adapter
Usage
First you need to generate an access token using Pixel Union's access token generator or by creating an Instagram application.
5937104658.5688ed0.675p84e21a0341gcb3b44b1a13d9de91
Then create a new CodFee\Instagram\Instagram
instance with your Instagram access token.
use CodFee\Instagram\Instagram; $instagram = new Instagram('Your-ACCESS-TOKEN');
To fetch the user's recent media data you may use the get()
method.
$instagram->get($table='users',$user='self',$condition='/media/recent'); default -> users/self/media/recent $table = users,tags,media,locations $instagram->getMediaById($id); /media/$id?access_token=$token
Note: You can only fetch a user's recent media from the given access token.
License
<<<<<<< HEAD
2268f95d350dc2387484a26cef8808249ba27753