Download the PHP package genxbe/kirby3-instagram without Composer
On this page you can find all versions of the php package genxbe/kirby3-instagram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download genxbe/kirby3-instagram
More information about genxbe/kirby3-instagram
Files in genxbe/kirby3-instagram
Package kirby3-instagram
Short Description Kirby3 plugin to fetch instagram photos from your profile.
License MIT
Informations about the package kirby3-instagram
Kirby3 Instagram feed
Fetch instagram photos without the need for app aproval. This plugin will download the photos and/or video thumbnails to local storage. All media will be stored in a json file.
Only the 20 latest photo's will be stored.
This plugin uses the basic user access token which you can generate for all testusers of your instagram app. (https://developers.facebook.com/docs/instagram-basic-display-api/overview#user-token-generator)
Options
Required are the client_id
(Instagram App ID) and client_secret
(Instagram App Secret).
All other options are optional.
Usage
-
find a place to add the
instagramLink
blueprint -
Add your client_id and client_secret to your config file, all other options are optional.
-
Don't forget to add your website redirect uri to the Valid OAuth Redirect URIs
-
You can add multiple website and thus use 1 app for all of your websites
- Format of the url you need to add is
https://yoursite.com/axi/instagram
-
-
Add the instagram account you want to use to the test users and ask them to accept the invite (instructions below)
-
Ask your user to enable the instagram link on the website, when this process is completed a first time fetch will already be done.
-
After the user has linked his Instagram you can start fetching via
php site/plugins/kirby3-instagram/fetch.php
- If you want to have regular updates you need to schedule this command via the cron. I would advise to do this every 30 or 60 minutes so you don't overload your API rate limit. (More info on https://developers.facebook.com/docs/graph-api/overview/rate-limiting/#platform-rate-limits)
Examples
Add linkInstagram to blueprint
After the first fetch you can start parsing the feed
You can check for a count of the feed to hide the block when no media is available yet.
Since we work with collections you can also use fieldMethods like limit
, filterBy
, etc...
Fields that can be used in the $media array based on the example above.
$media['id']
$media['timestamp']
$media['media_type']
$media['media_url']
$media['caption']
$media['permalink']
$media['username']
$media['thumbnail_url']
Setup cron
Every 30 minutes
Every hour
Faster is possible but do keep your rate limits in mind! (More info on https://developers.facebook.com/docs/graph-api/overview/rate-limiting/#platform-rate-limits)
Plugin installation
Download
Download and copy this repository to /site/plugins/kirby3-instagram
.
Git submodule
Composer
Facebook app configuration
Detailed instructions on: https://elfsight.com/blog/2016/05/how-to-get-instagram-access-token/ (step 1-2)
- Create a Facebook app
- Setup Instagram Basic display
- Important, your website OAuth url must be added as a valid OAuth redirect URI!
- All other url's (deauthorize & data deletion) don't really matter, you can enter your own website there.
- Don't request an app review
Adding test users
Detailed instructions on: https://elfsight.com/blog/2016/05/how-to-get-instagram-access-token/ (step 3)
- Add the feed you want to show as instagram test user
- Make sure your test users accepts the test invitation
Authenticate the instagram user and request User token
Follow instructions on https://xdocs.notion.site/Link-instagram-with-your-website-9aa72c4961074cb4b4f9b5d1e6322e36
Usage on multiple websites
You can use your 1 app for multiple sites by adding multiple OAuth redirect URI, please do keep your rate limit in mind. You can always create multiple facebook apps do divide the rate limit.
License
MIT