Canary is a Python3 bot designed for the McGill University Community Discord Server. The bot provides helper functions to users, as well as fun functions, a quote database and custom greeting messages.
GNU General Public License v3.0
11
stars
7
forks
source link
feat: update weather data source, remove wttr #519
Changed the data source of weather to dd.weather.gc.ca, rather than the HTML parsing of weather.gc.ca
wttr and wttr_moon have been deprecated/retired.
Added lxml to the dependency list
Motivation and Context
Currently the weather command is parsing the HTML of the weather page. This cuts out the middle man and directly parses the data from the government.
In order to continue using BeautifulSoup as a dependency and xml parser to match the style of the rest of the project, the lxml dependency was added to the project.
How Has This Been Tested?
This was tested on a personal server, and the output closely matches the previous output of the method.
This was also tested with/without lxml as an installed dependency, and fails if it is not included. The rest of the code is untouched.
wttr, wttr_moon, and wttrmoon have been tested, and are ignored/have no output.
Screenshots (if appropriate):
Previous weather output:
New weather output:
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist:
[x] My code follows the code style of this project.
[x] My change requires a change to the documentation.
Description
weather
todd.weather.gc.ca
, rather than the HTML parsing ofweather.gc.ca
wttr
andwttr_moon
have been deprecated/retired.lxml
to the dependency listMotivation and Context
Currently the
weather
command is parsing the HTML of the weather page. This cuts out the middle man and directly parses the data from the government.In order to continue using BeautifulSoup as a dependency and xml parser to match the style of the rest of the project, the
lxml
dependency was added to the project.How Has This Been Tested?
This was tested on a personal server, and the output closely matches the previous output of the method.
This was also tested with/without
lxml
as an installed dependency, and fails if it is not included. The rest of the code is untouched.wttr
,wttr_moon
, andwttrmoon
have been tested, and are ignored/have no output.Screenshots (if appropriate):
Previous weather output:
New weather output:
Types of changes
Checklist: