Skip to content

A Python script designed to monitor and track price changes within the Greater Toronto Area (GTA).

License

Notifications You must be signed in to change notification settings

JacYuan1/Fuel-Price-Tracker-in-the-Greater-Toronto-Area

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fuel Price Tracker in the Greater Toronto Area (GTA)

About the Project

This project is a Python script designed to monitor and track price changes in the Greater Toronto Area (GTA). Utilizing Selenium WebDriver for web scraping, the script extracts the current, previous, and upcoming prices and processes the data to determine the price trend. It then sends formatted notifications to a Discord channel via a webhook. This script can be scheduled to run at desired intervals (using Windows Task Scheduler), providing timely updates on price fluctuations aiding in informed decision-making.

This project is the spiritual successor of the original gas scraper project found here as it is much more accurate and secure than the previous project.

Features at a Glance

  • Retrieves and analyzes fuel prices for the current, previous, and upcoming day from a specified webpage.
  • Provides a summary of price trends.
  • Sends formatted price information and summary to a Discord channel through a webhook.

Installation Requirements

Ensure you have the following installed on your machine:

  1. Python
  2. Pip
  3. Requests
  4. Selenium (Official Website)
  5. Discord
  6. Google Chrome

Setup

Follow these steps to get the project up and running:

1. Install the necessary packages

Download and install the required packages listed above.

2. Configure Environment Variable

Set up your environment variable for the Discord webhook URL as well as the webhook itself. The variable name used in the code is WEBHOOK_URL.

  • Help with Discord Webhook: If you need help setting up a Discord webhook, check out this article.
  • Help with Environment Variables: If you need help setting up an environment variable, check out this article.

3. Download the Python script

You can either download the .py file here or you can use the git clone command:

git clone https://github.com/your-username/Fuel-Price-Tracker-in-the-Greater-Toronto-Area.git
cd Fuel-Price-Tracker-in-the-Greater-Toronto-Area

4. Schedule the Script

Set up the script to run automatically at a desired time.

  • Windows: Use the Windows Task Scheduler. Here's a video guide on how to do that.
  • Mac/Linux: Use Cron job. Learn more about Cron jobs.

Example Output

Here is an example output on a Discord channel:

ex_image

Additional Information

  • To deploy this script on other computers, you can convert it into an executable file using auto-py-to-exe.
  • By default, it is setup as Chrome for the Selenium webdriver however, there are other options such as Internet Explorer, FireFox and Safari browser. To setup as a different browser, check out this article here

Releases

No releases published

Packages

No packages published

Languages