This repository contains a project that harnesses the power of artificial intelligence to create content for social media, specifically Instagram. The project uses OpenAI's Whisper API for transcribing audio into text summaries and OpenAI GPT for generating summaries and hashtags. It also creates impactful images with OpenAI's DALL-E, leveraging the capabilities of generative AI. The project implements the data processing and formatting flow for automating posts with InstaBot, enhancing programming skills in Python by integrating various APIs and tools.
The aim of this project is to automate the process of posting an image on Instagram with content related to a podcast using only an MP3 audio file of the podcast. The project uses the latest version of the OpenAI library (1.3.9 as of December 2023), which differs significantly from the version used in the original course, with many enhancements and full functionality.
This project was completed as part of the course 'OpenAI and Python: Create Powerful Tools and Intelligent Chatbots with OpenAI APIs' on Alura. For more information about the course, visit Alura.
- Discover the power of artificial intelligence in creating content for social media, especially Instagram
- Transcribe audio into a text summary using OpenAI's Whisper API
- Use OpenAI GPT to create summaries and generate hashtags
- Create impactful images with OpenAI's DALL-E, exploring the capabilities of generative AI
- Implement the data processing and formatting flow for automating posts with InstaBot
- Enhance Python programming skills by integrating various APIs and tools
- Python 3.11.4
- OpenAI
- Tiktoken
- Dotenv
- Pydub
- PIL
- Instabot
The directory structure of the project is as follows:
openai-criando-uma-postagem-para-o-instagram-com-ia-generativa/
│ main.py
│ requirements.txt
│ .gitignore
│ README.md
- Clone the repository:
git clone https://github.com/goosekiing/openai-criando-uma-postagem-para-o-instagram-com-ia-generativa.git
- Navigate to the project directory:
cd openai-criando-uma-postagem-para-o-instagram-com-ia-generativa
- Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
- Install the required libraries:
pip install -r requirements.txt
Create a .env
file in the project directory with the following variables:
OPENAI_API_KEY
OPENAI_ORGANIZATION
USER_INSTAGRAM
PASSWORD_INSTAGRAM
AUDIO_PATH
FILE_NAME
AUDIO_URL
The OpenAI API keys should be obtained from OpenAI's website. As of December 2023, new users receive $5.00 credit, sufficient for this project. Instagram variables should be filled with the user's Instagram username and password. The audio file variables are personal and can be replaced directly in the code.
You can view the automated Instagram post created by this project on my Instagram:
The language used in this project is Brazilian Portuguese (pt-br).
Feel free to explore, modify, and use this project as a foundation for your own AI-driven social media content creation!
GitHub Username: goosekiing