This is a web-based application that takes a website URL as input and generates a well-crafted social media post based on the content of that URL.The app makes it easy to create visually appealing and engaging social media content.
- Website Scraping: Extracts the main content from a given website URL.
- Social Media Caption Generation: Uses an AI-based model to generate a well-formatted and engaging social media caption.
- Flask: A lightweight web framework for Python.
- uAgents: Decentralized AI agents used for handling the different tasks of website scraping, post generation, and image generation.
- OpenAI: Used for generating captions and images via AI models.
- HTML & CSS: Frontend for displaying the web interface.
To set up this project locally, follow these steps:
- Python 3.9+
pip
(Python package installer)- OpenAI API Key (required for generating captions and images)
-
Clone the Repository:
git clone https://github.com/kshipra-fetch/social-media-post-creator.git cd social-media-post-creator
-
Create a Virtual Environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies: Install the required Python packages by running:
pip install uagents openai bs4 flask requests pip install 'flask[async]'
-
Set Up Environment Variables: Create a
.env
file in the root directory of your project and add your OpenAI API key and agent seeds:OPENAI_API_KEY=your-openai-api-key
-
Update the SEED phrase in all the agent files
-
Run the Agents: Keep all the three agents running in separate terminals
website-scraping-agent.py post-caption-generator.py
-
Update Agent Address Copy the agent address after you run the agents from the terminal and paste it in
app.py
-
Run the Application: You can now run the Flask app:
python app.py
-
Access the Web App: Open your browser and go to:
http://127.0.0.1:5000/
- Enter a website URL into the provided input field on the homepage.
- Click on the "Generate Caption" button.
- The app will display a caption in the center of the screen.