Welcome to LinkedInfluencer, a cutting-edge Python application designed to transform your LinkedIn presence by automating the creation and posting of engaging content. Leveraging the power of RSS feeds, OpenAI's GPT, and AWS services, this tool ensures your LinkedIn feed remains active, relevant, and irresistibly engaging—all without lifting a finger!
- Automated RSS Aggregation: Fetches and aggregates news from TechCrunch and Ars Technica. Can easily be updated to use different sources.
- AI-Powered Content Creation: Utilizes OpenAI to generate compelling LinkedIn posts.
- Cloud-Native Deployment: Fully automated using AWS Lambda, DynamoDB, and S3.
- Automatic Posting: Automatically posts content to LinkedIn using Zapier.
- Scalable and Maintainable: Containerized with Docker for easy scalability and maintenance.
Before you begin, ensure you have met the following requirements:
- Python 3.11+: Ensure Python is installed on your machine.
- Docker: For containerizing the application.
- AWS Account: To deploy AWS Lambda, DynamoDB, and S3 services.
- OpenAI API Key: To utilize OpenAI's GPT for content creation.
- Zapier Account: For automatically posting content to LinkedIn.
- LinkedIn Account: Well, duh.
-
Clone the Repository
git clone https://github.com/jaylann/LinkedInfluencer.git cd LinkedInfluencer
-
Set Up Environment Variables
Create a
.env
file based on the provided template:cp .env.template .env
Fill in the required environment variables in
.env
:OPENAI_API_KEY=YOUR_OPENAI_API_KEY AWS_REGION=YOUR_AWS_REGION DYNAMODB_SCRAPED_TABLE_NAME=YOUR_DYNAMODB_SCRAPED_TABLE_NAME DYNAMODB_POSTS_TABLE_NAME=YOUR_DYNAMODB_POSTS_TABLE_NAME S3_BUCKET_NAME=YOUR_S3_BUCKET_NAME RSS_FEED_KEY=YOUR_RSS_FEED_S3_KEY RSS_FEED_TITLE=YOUR_RSS_FEED_TITLE RSS_FEED_DESCRIPTION=YOUR_RSS_FEED_DESCRIPTION RSS_FEED_LINK=YOUR_RSS_FEED_LINK
-
Install Dependencies
It's recommended to use a virtual environment:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
The application can be run locally or deployed to AWS Lambda. Below are instructions for both scenarios.
-
Activate Virtual Environment
source venv/bin/activate
-
Execute the Script
python main.py aggregate_news python main.py process_items
Available actions:
aggregate_news
: Fetches RSS feeds and saves items to DynamoDB.process_items
: Processes saved DynamoDB items to create LinkedIn posts and trigger posting. These can also be set via an environment variable "ACTION". The default value is "aggregate_news".
-
Build Docker Image
Ensure you're using the correct platform (
x86
orarm
):docker build -t linkedinfluencer .
-
Tag the Docker Image
Replace
<AWS_ACCOUNT_ID>
and<REGION>
with your AWS details:docker tag linkedinfluencer:latest <AWS_ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com/linkedinfluencer:latest
-
Push to Amazon ECR
docker push <AWS_ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com/linkedinfluencer:latest
-
Set Up AWS Lambda
- Create a Lambda Function using the pushed Docker image.
- Set Environment Variable "ACTION": Decide on "aggregate_news" or "process_items" depending on the Lambda function.
- Assign Execution Role: Ensure the Lambda execution role has permissions to access S3, DynamoDB, and other required AWS services.
-
Schedule with EventBridge
- Data Gathering: Trigger
aggregate_news
at 00:00 daily. - Post Creation: Trigger
process_items
during peak LinkedIn engagement times.
- Data Gathering: Trigger
Zapier is integrated to handle the automated posting process:
- RSS Feed Setup: The application updates an XML RSS feed stored in S3.
- Zapier Connection: Configure Zapier to monitor the RSS feed and post new items to LinkedIn.
- Automation Workflow: As new posts are added to the RSS feed, Zapier triggers LinkedIn posts automatically.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Made with ❤️ by Justin Lanfermann