This Twitter bot that monitors the top 500 most subscribed YouTube channels subscriber count and posts a tweet whenever a channel reaches a 1 million subscriber increase. The bot uses the YouTube Data API to fetch subscriber counts and the Twitter API to post tweets.
You can check out the bot on Twitter: YoutubeStatsBot
Learn how to build this Twitter bot. Step-by-step guide with API integration and deployment tips. For a detailed tutorial on how to build this bot, check out the full guide on Medium.
-
Clone this repository to your local machine:
git clone https://github.com/yourusername/twitter-bot-youtube-subscriber-tracker.git
-
Install the required dependencies by using the requirements.txt file:
pip install -r requirements.txt
-
Set up your API keys:
- Follow the instructions in the Twitter Developer Documentation to obtain your Twitter API keys.
- Follow the instructions in the YouTube Data API Guide to obtain your YouTube API key.
-
Create a .env file in the root of the project and add your API keys:
YOUTUBE_API_KEY=your_youtube_api_key TWITTER_API_KEY=your_twitter_api_key TWITTER_API_SECRET_KEY=your_twitter_secret_key TWITTER_ACCESS_TOKEN=your_access_token TWITTER_ACCESS_SECRET=your_access_token_secret