This project automates the posting of Rotten Tomatoes movie data on Twitter using Python scripts. It fetches the latest upcoming movies from the Rotten Tomatoes website and posts tweets with movie details, ratings, and poster images.
- Fetches the latest movie data from Rotten Tomatoes using web scraping
- Posts tweets with movie details, ratings, and poster images
- Checks for previously posted movies to avoid duplicate tweets
- Saves data of posted movies to avoid reposting in the future
-
Clone the repository:
git clone https://github.com/your_username/rotten-tomatoes-twitter-automation-python.git
-
Install the required packages:
pip install requests pandas beautifulsoup4
-
Set up Twitter API keys in
post_tweet_v2.py -
Run the script:
python rotten_tomatoes.py
- Customize the tweet content or frequency of posting in
rotten_tomatoes.py - Ensure
already_posted_movie.csvis present for tracking posted movies
-
Create a Twitter developer account at Twitter Developer.
-
Create a new app and note down the API key, API secret key, access token, and access token secret.
-
Create a
config_tweet.inifile in the project directory with the following format:[Twitter] api_key = YOUR_API_KEY api_secret = YOUR_API_SECRET acess_token = YOUR_ACCESS_TOKEN acess_secret_token = YOUR_ACCESS_SECRET_TOKEN bearer_token = YOUR_BEARER_TOKEN
-
Update the auth_cred() function in post_tweet_v2.py to read these credentials from config_tweet.ini
The auth_cred() function reads the Twitter API credentials from config_tweet.ini and authenticates the API client using tweepy.Client and tweepy.OAuth1UserHandler.
The post_tweet(tweet, file_name) function in post_tweet_v2.py posts a tweet with the provided tweet content and an optional image (file_name).
- Ensure
config_tweet.iniis correctly configured with your Twitter API credentials. - Run the
rotten_tomatoes.pyscript to fetch the latest movies from Rotten Tomatoes and post tweets about them on Twitter.
Thank you for considering supporting this project! Your sponsorship helps in maintaining and improving this project.
Supported Funding Platforms:
- PayPal: Donate Now Your contribution is greatly appreciated!