A python script that uses selenium webdriver to check the internet speed and tweet at the service provider if the speed is below the promised speed.
- Python 3.x
- selenium
- dotenv
- ChromeDriver
- Usage
Clone the repository
Create a .env
file in the same directory as the script and add the following environment variables:
path
: Path to the ChromeDriver binaryemail
: Twitter email to use for logging inpassword
: Twitter password to use for logging in- Install the required packages with
pip install -r requirements.txt
Run the script with pythonmain.py
The promised download and upload speeds are set as constants:
PROMISED_DOWN
= 50PROMISED_UP
= 10
- The script loads environment variables from the
.env
file usingload_dotenv
from the dotenv library. - The ChromeDriver is initialized with the path from the environment variables.
- The
get_internet_speed
method navigates to speedtest.net, clicks the "Go" button, waits for the speed test to complete and retrieves the download and upload speeds. - The
tweet_at_provider
method checks if the download speed is less than the promised speed, logs into Twitter, and tweets at the service provider if the speed is below the promised speed.