This project is a Python application designed to automate the process of generating professional LinkedIn posts for new GitHub projects. It leverages the GitHub API to fetch project details and the Google Generative AI API (Gemini 2.5 Flash) to create engaging, concise, and relevant social media content based on the repository's information.
The linked-post-bot simplifies the task of announcing new software projects on LinkedIn. By utilizing AI, it reads the project's README and repository metadata, then crafts a compelling LinkedIn post tailored for a technical audience, complete with relevant hashtags.
- GitHub Integration: Fetches repository details, including the README, description, topics, and stargazers count, using the
PyGithublibrary. - AI-Powered Content Generation: Uses the Google Generative AI API (specifically
gemini-2.5-flash) to analyze project information and generate a professional LinkedIn post. - Concise and Engaging Output: Generates posts designed to highlight key features, encourage engagement, and include appropriate technical hashtags.
- Dynamic User Input: Prompts the user for API keys and the target GitHub repository at runtime, eliminating the need to edit the script directly.
The project requires Python 3.x and the dependencies listed in requirements.txt.
To get started, you will need API access for both GitHub and Google Generative AI.
-
Clone the repository:
git clone https://github.com/juto-shogan/linked-post-bot.git cd linked-post-bot(Note: Replace
juto-shogan/linked-post-bot.gitwith your actual repository URL if it differs.) -
Set up a Python virtual environment (recommended):
python -m venv venv # On Windows: .\venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Obtain API Keys:
- GitHub Personal Access Token: Create one on GitHub (Settings > Developer settings > Personal access tokens). Ensure it has read access to the repository data.
- Google Generative AI API Key: Obtain an API key for Google's Generative AI services.
Once dependencies are installed, run the main.py script from your terminal:
python main.pyThe script will prompt you to enter your GitHub Personal Access Token, Google Generative AI API key, and the target GitHub repository name (e.g., juto-shogan/adidas-Analysis). It will then retrieve the repository data, generate a LinkedIn post, and print the generated content to the console.
The bot performs the following steps:
- User Input: Prompts the user for necessary credentials and the target repository.
- Initialization: Connects to GitHub and Google Generative AI using the user-provided API keys.
- Data Retrieval: Accesses the specified GitHub repository and retrieves essential information (README, description, topics, etc.).
- AI Generation: Sends the project details to the Gemini 2.5 Flash model with a prompt designed for technical LinkedIn content.
- Output: Prints the AI-generated LinkedIn post to the terminal, ready for review and posting.
Somto Mbonu
- GitHub: juto-shogan
- Email: [email protected]