A Python-based automation tool that generates Instagram story images with captions and posts them. The project consists of two scripts:
add-story.py
: Creates images with captions.post-story.py
: Posts the generated images to Instagram usinginstagrapi
.
- Automatically generates Instagram story images with captions.
- Customizable background and font for the stories.
- Posts stories directly to Instagram for either "Close Friends" or public audiences.
- Archives posted stories to a separate folder.
- Tracks last posting time to ensure stories are posted daily.
This script generates story images with the provided captions.
python add-story.py <caption_story_1> <caption_story_2> ...
python add-story.py "Caption for first story" "Caption for second story"
- Story images are saved in the
queue
folder, named with a timestamp.
This script posts the generated story images to Instagram. It uses the credentials stored in environment variables.
- Set up environment variables for Instagram credentials:
export USER="your_instagram_username"
export PASS="your_instagram_password"
python post-story.py [-nc | --no-close]
-nc
,--no-close
: Post the stories publicly instead of for "Close Friends."
-
Post for "Close Friends":
python post-story.py
-
Post publicly:
python post-story.py --no-close