$ npm i strapi-plugin-instagram
Example or
$ yarn add strapi-plugin-instagram
./config/plugins.js
module.exports = ({ env }) => ({
instagram: {
facebookAppClientId: env('INSTAGRAM_APP_CLIENT_ID'),
facebookAppClientSecret: env('INSTAGRAM_APP_CLIENT_SECRET'),
// Optionnal - Use `overrideAdminUrl` during development
// to redirect after instagram login to your local server
// (take a look at https://ngrok.com/ )
// ex: 'https://GROK_ID.eu.ngrok.io/admin',
overrideAdminUrl: null,
},
});
After connecting your Instagram account throught the admin, this plugin will fetch your instagram posts with the Instagram basic display API
Add the following cron jobs to trigger associated tasks:
./config/functions/cron.js
// At every 30th minute
'*/30 * * * *': () => {
strapi.plugins.instagram.services.instagramupdater.default.fetchFeed();
},
// At 00:00
'0 0 * * *': () => {
strapi.plugins.instagram.services.instagramtokenrefresher.default.refreshToken();
},
You will need to create a Facebook App and provide your informations in the plugin config.
If you need to scrap posts from an Instagram account you don't control, take a look to strapi-plugin-instagram-feed
--
I work on this plugin on my spare time, any help is welcome.