Welcome to the "Daily Quotes Python Script for Instagram" project! This script automates the process of creating and posting daily quote images to your Instagram account @abdallahquotes. 🚀
This project uses Python to generate visually appealing quote images and then posts them on your Instagram account automatically using GitHub Actions. The script fetches a quote based on the number of days passed since a target date, wraps it around an elegant template, and finally shares it on your Instagram feed. 🎨
-
Schedule: The GitHub Actions workflow is scheduled to run every day at midnight. 🕛
-
Quote Retrieval: The script calculates the number of days passed since a target date. It then loads a quote and template based on this count. 🗓️
-
Data Loading: The script loads the quote and template data from the
data.json
file. 📄 -
Image Generation: The script wraps the quote text to fit nicely within the template, combines it with the author's name, and creates a beautiful image. 🖼️
-
Instagram Posting: The generated image is automatically uploaded to your Instagram account using the Instagrapi library, along with a caption indicating the day's count. 📤
-
GitHub Repository: Clone or fork this repository to your GitHub account.
-
Secrets: In your repository, go to "Settings" > "Secrets" and add two secrets:
IG_USERNAME
: Your Instagram usernameIG_PASSWORD
: Your Instagram password
-
Dependencies: The required Python packages are listed in the
requirements.txt
file. The workflow will install these dependencies.
main.py
: The main Python script that generates quote images and posts to Instagram.data.json
: Contains quote and template data..github/workflows/main.yml
: GitHub Actions workflow configuration.assets/
: Folder containing images and fonts used in the project.quotes/
: Folder where generated quote images will be saved.
- Modify the
data.json
file to add your own collection of quotes and templates. - Adjust frames, fonts, font sizes, and image positions in the templates to match your preferred style.
Now you're all set to start sharing daily inspirational quotes on your Instagram. The GitHub Actions workflow will take care of the rest.
Feel free to customize the templates, fonts, and colors to create a unique style for your quote images.
Happy coding and spreading positivity! 🌟
Project created with ❤️ by Abdallah Tantawy