idoneam / Canary

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

Open Sam-per opened 2 years ago

Sam-per commented 2 years ago

Description

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:

image

New weather output:

image

Types of changes

Checklist:

davidlougheed commented 1 day ago

thanks for this (2 years later). working on integrating it into my refactor + merging it, unfortunately that means the commits will be lost to time.