In conclusion this addon does the job, but documentation and details could be improved. What's good: - Works wit…
TigerXY
Fetch and display Instagram media with minimum effort, using the newest graph API from Facebook.
This add-on includes methods to use the API and a block that shows the posts of the given account. The block contains minimum styling so it's easy to override the style on your site.
After you've installed the package, you need to get an access token for the account you want to display photos for. It takes around 5 minutes. The steps are described here:
https://developers.facebook.com/docs/instagram-basic-display-api/overview#user-token-generator
In short, you need to:
The generated token is used as input for the block, and then the user's photos are displayed. Don't worry about the token expiring, this package will automatically renew the tokens.
The automatic renewal is implemented as a queueable job in Concrete5 and can be seen in the admin dashboard under "Optimization" -> "Automated jobs". If the job has run successfully or failed you can see it here. Here the job can also be run manually, automated in other ways using the webhook (CRON, etc.), or rescheduled to be run at a different interval. The default interval is 30 days. Though it shouldn't be necessary to change these settings, as the default values work well with the Instagram API.
Caching and performance
The Instagram block will fetch user media on every page load, so remember to turn on Concrete5's block caching, or it can significantly slow down your page. The default caching time is 1 day, so after posting on Instagram, it can take up to 1 day before it shows up in the block.
You can alter this by clicking on the block in edit mode -> advanced -> check "Override block type cache settings" -> and change the caching time among other settings.