Network Engineer Jokes Twitter Bot

This project is a Twitter bot that posts Network Engineering jokes generated by the LLama3 AI Model. The bot fetches jokes and relevant hashtags, composes tweets, and posts them to Twitter at regular intervals. The application runs on my home Proxmox server within an LXC container.
The bot application is deployed using Terraform on my home Proxmox server. This approach simplifies the process of rebuilding the same LXC container along with the application code, ensuring consistency and ease of deployment.
Key Features
- Automated Joke Generation: Uses LLama3 to generate Network Engineering jokes.
- Hashtag Generation: Automatically generates relevant hashtags for each joke.
- Scheduled Posting: Posts a new joke to Twitter every 60 minutes.
- Tweepy: For interacting with the Twitter API.
How It Works
The application starts by loading API keys and tokens from a .env file. It then requests a joke and relevant hashtags from LLama3.1. The joke and hashtags are combined into a tweet. The application authenticates with the Twitter API using OAuth1 and Client, and posts the composed tweet to Twitter. All steps and any errors encountered are logged. The process waits for 60 minutes before repeating.
Steps to Deploy
First, clone the repository to get the Terraform files from GitHub. Then, run Terraform commands to create an LXC container on Proxmox. The application workflow involves three main steps: requesting a joke from LLama3, receiving the joke, and posting it to Twitter. This pipeline runs every hour.
Example Tweet
Why do network engineers love nature? Because it's full of NATural beauty! 🌳🌐
#NetworkEngineer #TechHumor #Networking #Jokes
Please visit the @NetworkJokes Twitter/X profile to see my automated account in action.
NetworkEngineerJokes X Profile

Source Code