shahrukhkhan / instagram
This package provides you easy way to communicate with instagram api
dev-master
2017-07-24 16:46 UTC
Requires
- php: >=5.6.4
- guzzlehttp/guzzle: ^6.3
This package is auto-updated.
Last update: 2024-11-20 01:21:50 UTC
README
This is a simple package to provide you all the instagram API accessible at one place. While writing this package I had php7.0 installed but can work with php5.6 as well just change the guzzle version.
Installation
composer require shahrukhkhan/instagram
or add the following in your composer.json file require section
"require": {
"shahrukhkhan/instagram": "dev-master"
}
Requirements
- Instagram app
- Instagram Client Id
- Instagram Client secret
- Google maps API key from https://developers.google.com/maps/web/
Once you have obtained your instagram client id place it in your .env file as:
- INSTAGRAM_CLIENT_ID=
- INSTAGRAM_REDIRECT_URI=
- INSTAGRAM_CLIENT_SECRET=
- GOOGLE_MAPS_KEY=
once done that access the function by Instagram::functionName($params);
Functions
To auth with this package use auth() function from your route, you may mention multiple scopes as array
Route::get('instagram-auth', function(){ return redirect()->away(\Shahrukh\Instagram\Instagram::auth($scopes)); });
List of functions available
exchangeCodeForToken() // expects the code you received while authenticating, and gives you access token in return getSelf() // gives information about logged in user getSelfMedia() // gives media list of logged in user getFollowedBy() // expects access token and user id(default is self), return the list of users who follows the user in question getFollows() // expects access token and user id(default is self), return the list of users, user in question follows getFollowRequest() // expects access token and user id (default is self), return the follow requests user in quesiton received getRelationship() // expects access token and user id, get information about a relationship of logged in user with mentioned user id changeRelationship() //expects access token and user id, modify the relationship between the current user and the target user. getMedia() // expects access token and media id, get information about a media object. searchMedia() //expects access token, area and distance (default distance is 1000 mtrs), searches for recent media in a given area.