Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacyuan1/fuel-price-tracker-in-the-greater-toronto-area
A Python script designed to monitor and track price changes within the Greater Toronto Area (GTA).
https://github.com/jacyuan1/fuel-price-tracker-in-the-greater-toronto-area
gas-prices gas-tracker python python-scraper python-script selenium selenium-webdriver toronto toronto-gas-price
Last synced: 28 days ago
JSON representation
A Python script designed to monitor and track price changes within the Greater Toronto Area (GTA).
- Host: GitHub
- URL: https://github.com/jacyuan1/fuel-price-tracker-in-the-greater-toronto-area
- Owner: JacYuan1
- License: gpl-3.0
- Created: 2023-10-08T07:12:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-09T00:08:44.000Z (about 1 year ago)
- Last Synced: 2023-10-09T08:25:37.003Z (about 1 year ago)
- Topics: gas-prices, gas-tracker, python, python-scraper, python-script, selenium, selenium-webdriver, toronto, toronto-gas-price
- Language: Python
- Homepage:
- Size: 84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/JacYuan1/Gas-Price-Scraper-Project) 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](https://www.python.org/downloads/)
2. [Pip](https://pip.pypa.io/en/stable/installation/#)
3. [Requests](https://pypi.org/project/requests/)
4. [Selenium](https://pypi.org/project/selenium/) ([Official Website](https://www.selenium.dev/documentation/webdriver/))
5. [Discord](https://discord.com/download)
6. [Google Chrome](https://www.google.com/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](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks).
- **Help with Environment Variables:** If you need help setting up an environment variable, check out this [article](https://www3.ntu.edu.sg/home/ehchua/programming/howto/Environment_Variables.html).### 3. Download the Python script
You can either download the .py file [here](https://github.com/JacYuan1/Fuel-Price-Tracker-in-the-Greater-Toronto-Area/blob/main/Gas_Price_Script_v2.py) or you can use the git clone command:
```bash
git clone https://github.com/your-username/Fuel-Price-Tracker-in-the-Greater-Toronto-Area.git
``````bash
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](https://www.youtube.com/watch?v=ic4lUiDTbVI) on how to do that.
- **Mac/Linux:** Use Cron job. Learn more about [Cron jobs](https://www.redhat.com/sysadmin/linux-cron-command).## Example Output
Here is an example output on a Discord channel:
![ex_image](example_output.jpg)
## Additional Information
- To deploy this script on other computers, you can convert it into an executable file using [auto-py-to-exe](https://github.com/brentvollebregt/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](https://www.selenium.dev/documentation/webdriver/browsers/)