Opened 18 years ago
Closed 18 years ago
#3811 closed enhancement (fixed)
Add Environment Canada weather grabber for Canadian locations
| Reported by: | anonymous | Owned by: | ldunning |
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | mythweather | Version: | head |
| Severity: | medium | Keywords: | Canadian weather, Environment Canada |
| Cc: | Ticket locked: | no |
Description
This is an enhancement to MythWeather in the form of a new grabber script. This script allows MythWeather to report on Canadian cities. Data is retrieved from Environment Canada (http://www.weatheroffice.gc.ca/).
The enhancement includes the following files:
envcan.pl ENVCAN-Stations.xml ENVCANParser.pm ENVCANLocation.pm ENVCAN_icons
All files should be copied into the <prefix>/share/mythtv/mythweather/scripts directory.
envcan.pl MUST be marked as executable. It is the script called to actually download the weather data. There are notes for each file included in the PERL comments.
The code is by no means perfect, but it does work. Comments on improving it are welcome.
Thanks!
-- Joe Ripley vitaminjoe@…
Attachments (14)
Change History (24)
by , 18 years ago
| Attachment: | ENVCAN_icons added |
|---|
by , 18 years ago
| Attachment: | ENVCAN-Stations.xml added |
|---|
Describes all Enviroment Canada locations and URLs to the data
by , 18 years ago
| Attachment: | ENVCANParser.pm added |
|---|
PERL module used to parse HTML data. Requires HTML::Parser module.
by , 18 years ago
PERL script that downloads Environment Canada data. MUST be marked executable.
comment:1 by , 18 years ago
Forgot to mention that this grabber provides data for the following screens:
Current Conditions 3 Day Forecast 6 Day Forecast
I'm working on an animated maps script that will use Environment Canada's animated radar and satellite maps as well.
-- Joe Ripley vitaminjoe@…
by , 18 years ago
| Attachment: | ENVCAN-Maps.xml added |
|---|
Environment Canada satellite map XML database (animated and static)
by , 18 years ago
| Attachment: | ENVCANMapSearch.pm added |
|---|
PERL module used to search the ENVCAN-Maps.xml file
by , 18 years ago
| Attachment: | envcan_animaps.pl added |
|---|
PERL script used to grab data for Environment Canada animated satellite images
comment:2 by , 18 years ago
Just added a few more files that provides access to the animated satellite imagery provided by Environment Canada. The 'envcan_animaps.pl' file MUST be marked as executable.
All files must be copied to the <prefix>/share/mythtv/mythweather/scripts directory. After that, all animated satellite images available at http://www.weatheroffice.gc.ca/satellite/ can be used in MythWeather.
The scripts work for me, and I've tested a few different animated images. Please advise if you encounter bugs or have suggestions for improvements.
Thanks!
-- Joe Ripley vitaminjoe@…
by , 18 years ago
| Attachment: | envcan.2.pl added |
|---|
New version of envcan.pl. Adds caching support. Must be marked executable.
comment:3 by , 18 years ago
Added a new version of envcan.pl. This version caches the weather data received from Environment Canada using the same Data::Dumper method that Lucien's scripts use. The data is cached for 15 minutes.
-- Joe Ripley vitaminjoe@…
by , 18 years ago
| Attachment: | envcan.2.pl.patch added |
|---|
Add wind gust data from Environment Canada. Fix kph to mph conversion. Apply to envcan.2.pl.
by , 18 years ago
| Attachment: | envcan.3.pl added |
|---|
Ignore envcan.2.pl.patch... bad conversion logic. This is the latest copy of envcan.pl. Adds correct wind gust speed and SI/ENG conversions.
comment:4 by , 18 years ago
Could you use "svn add" to add the files to your local checkout, then use "svn diff" to get a single patch containing all the new files and changes? It makes it easier to review and apply.
Looking at the number of files being added here and those for the UK grabber I'm writing, I think I'll make a change to the code so that we can group scripts and their support files into subdirectories e.g. scripts/envcan/, scripts/bbc/, scripts/nws/.
by , 18 years ago
| Attachment: | envcan.patch added |
|---|
Patch to include Environment Canada grabber as produced by 'svn diff'.
comment:5 by , 18 years ago
No problem. I've added the files and generated the diff. The patch (envcan.patch) includes the latest versions of the Environment Canada grabber and all its related files. envcan.pl and envcan_animaps.pl must be marked as executable.
I agree that we'll need some form of script organization to prevent the jumble of multiple grabbers.
-- Joe Ripley vitaminjoe@…
comment:6 by , 18 years ago
Did some checking on the legality of using Environment Canada as a data source. Looks like it should be OK. I'm not a lawyer, but as far as I can tell from the website, MythTV usage should fall into the 'Non-commercial reproduction' of the weather data.
More at: http://www.ec.gc.ca/copy_e.html
-- Joe Ripley vitaminjoe@…
comment:7 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:8 by , 18 years ago
by , 18 years ago
| Attachment: | envcan_animaps.patch added |
|---|
Patch to include Animated Maps grabber for Environment Canada. This file was missed in the previous envcan.patch.
comment:9 by , 18 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
Stuart,
I missed a file in my previous patch... sorry about that.
I've attached the file as a patch. Please include it with your MythWeather updates as well. It allows users to download animated satellite images from Environment Canada. As with the other grabbers, it must be marked executable.
Thanks!
-- Joe Ripley vitaminjoe@…
comment:10 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |

Maps Enviroment Canada icons to MythWeather icons