CLI to post images to Instagram using Puppeteer.
The goal of this project is to make it easy to programatically post an image to Instagram with a caption.
instagram-poster -username [email protected] -password mysecurepassword -image /Users/me/Desktop/mypic.jpg -caption "Check out my picture"
instagram-poster --username <username> --password <password> --image <image_path> [-caption <caption>] [-executablePath <chrome_path>] [-agent <user_agent>] [-debug]
or, if installed locally:
node index.js --username <username> --password <password> --image <image_path> [-caption <caption>] [-executablePath <chrome_path>] [-agent <user_agent>] [-debug]
npm install -g instagram-poster
- Make sure you have node and npm installed
- Clone this repository
cd
to this repository- If you already have Chrome/Chromium installed, and you want to use that version, run
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
- run
npm install
- You should be able to run the program now
- If you opted to use your previously installed version of Chrome in step 4, make sure you specify your path to Chrome when you run the program
- The image path will be relative to the directory you are in when you run the program.
- The only way to upload an image to instagram outside of their app is on their mobile site. This program simulates the mobile experience on your computer.
- If you are running on a Raspberry Pi, you should also use a custom executable path to point to Chromium Browser, since the Chromium that comes with Puppeteer does not work on Raspbian.