I created this tiny application so that I could ease the process of posting to Instagram. I didn't want to have to open up the app to post manually, but I still felt like it's good practice to share some of my photography on occasion. With a bit of configuration, this script will let you publish a photo with a caption of your choosing to an account for which you have login credentials!
conda env create environment.yml
sudo apt install firefox
chmod +x instabot.sh
- Replace
username
andpassword
in your config with your username and password. Remember never to commit & push your config! - Determine the classNames associated with a few different components on your Instagram web page. This is a little bit cumbersome, and I'll try to find a way around it, but for now this is the process 😞
bash -i instabot.bash
- Replace
sample_config.yml
with your config file. - The
sample_config.yml
file is preloaded with reference to a couple of test images you can use to try the tool out.
- Replace
I created this project so I could automate posting photos to Instagram. To run the script on a schedule, I'm using crontab.
- Open up your
crontab
configuration to edit.crontab -e
- Add the entry to schedule the
instabot.py
script.m h dom m dow DISPLAY=:0 /home/user/path/to/this-project/insta-bot/instabot.bash
- The
DISPLAY:=0
allows us to launch the Firefox browser via acronjob
in headless mode (i.e., without a display).
- The