Some code using Puppeteer (headless Chromium browser) to schedule posting behavior on Instagram, useful for business accounts.
-
Run
npm install
-
Set up
./config.json
:
username
: your Instagramusername
password
: your Instagrampassword
upload_image
: the filepath of the image to be uploaded (has to be a.jpg
, and if the image isn't square, some parts will be cropped out). I have only verified single-image uploads and am uncertain what will happen if multiple files are provided.
-
Write the text caption to be uploaded into
./upload_caption.txt
-
Specify the datetime for posting in
./scheduler.py
, then runpython ./scheduler.py
. This code was tested with Python 3.
Note: the Instagram terms of use I found were unclear on the use of automated posting; use this code at your own risk of being banned