This project generates LinkedIn posts by scraping headlines from a news website and using the Gemini API with the gemini-1.5-flash
model for content creation.
- Headline Scraping: Scrapes the first headline from a specified news website (e.g., BBC News).
- Content Generation: Uses the Gemini API to create LinkedIn posts based on the scraped headlines.
- Gemini API: Utilizes the
gemini-1.5-flash
model to generate LinkedIn posts. - BeautifulSoup: For web scraping to extract headlines.
- Requests: To make HTTP requests to news websites and the Gemini API.
-
Clone the Repository
git clone https://github.com/yourusername/LinkedIn-Post-Generator.git cd LinkedIn-Post-Generator
-
Install Dependencies
Ensure you have Python installed, then install the required packages:
pip install requests beautifulsoup4 google-generativeai python-dotenv
-
Set Up Environment Variables
Create a
.env
file in the root directory of the project and add your API keys:API_KEY=your_gemini_api_key
-
Run the Script
Execute the script to generate and post LinkedIn content:
python app.py
The script scrapes the first headline from the specified website. You can customize the URL or website as needed.
The scraped headline is used as input for the Gemini API to generate LinkedIn posts. The gemini-1.5-flash
model is employed for content creation.
For scraping instructions and techniques, refer to this video tutorial which demonstrates how to scrape headlines effectively.
- Ensure you have valid Gemini API.
- Update the
.env
file with your credentials before running the script.
This project is licensed under the MIT License - see the LICENSE file for details.