Code: Select all
[Variables]
SiteURL=https://weather.gc.ca
PageURL=https://weather.gc.ca/city/pages/on-143_metric_e.html
; regexBase strings: 1 Header, 2 Current Conditions, 3 Forecast Issue Time, 4 Graphic Forecast, 5 Detailed Forecast, 6 Normals, 7 Averages, 8 Yesterday
regexBase=(?siU)property="mainContentOfPage"(.*)</ul>(.*)<h2>Forecast.*Forecast(.*)>(.*)Detailed Forecast(.*)Normals:(.*)<h2>Averages(.*)<h2>Yesterday(.*)</details>
; regexGraphic strings: Day 1: 1 Weekday, 2 Date, 3 Month, 4 Icon, 5 High Temperature, 6 Day POP, 7 Day Text, 8 Low Temperature, 9 Night POP, 10 Night Text
; Day 2: 11 Weekday, 12 Date, 13 Month, 14 Icon, 15 High Temperature, 16 Day POP, 17 Day Text, 18 Low Temperature, 19 Night POP, 20 Night Text
; Day 3: 21 Weekday, 22 Date, 23 Month, 24 Icon, 25 High Temperature, 26 Day POP, 27 Day Text, 28 Low Temperature, 29 Night POP, 30 Night Text
; Day 4: 31 Weekday, 32 Date, 33 Month, 34 Icon, 35 High Temperature, 36 Day POP, 37 Day Text, 38 Low Temperature, 39 Night POP, 40 Night Text
; Day 5: 41 Weekday, 42 Date, 43 Month, 44 Icon, 45 High Temperature, 46 Day POP, 47 Day Text, 48 Low Temperature, 49 Night POP, 50 Night Text
; Day 6: 51 Weekday, 52 Date, 53 Month, 54 Icon, 55 High Temperature, 56 Day POP, 57 Day Text, 58 Low Temperature, 59 Night POP, 60 Night Text
; Day 7: 61 Weekday, 62 Date, 63 Month, 64 Icon, 65 High Temperature, 66 Day POP, 67 Day Text
regexGraphNight=.*div-row4.*title="min">(.*)<.*<p class=".*"(?(?= title).*>.*>(.*)<).*<p class.*>(.*)<
regexGraphDay=.*title="(.*)".*br>(\d+)[^\d].*title="(.*)".*<img.*src="(.*)".*title="max">(.*)<.*<p class=".*"(?(?= title).*>.*>(.*)<).*<p class.*>(.*)<
regexGraphic=(?siU).*div-row1 div-row-head(?(?=")#regexGraphDay#)#regexGraphNight##regexGraphDay##regexGraphNight##regexGraphDay##regexGraphNight##regexGraphDay##regexGraphNight##regexGraphDay##regexGraphNight##regexGraphDay##regexGraphNight##regexGraphDay#
[msrSite]
Measure=WebParser
URL=#PageURL#
RegExp=#regexBase#
UpdateRate=600
FinishAction=[!SetOption msrHeaderAlertPage URL "#siteURL#[*&msrHeaderAlertURL*]"][!CommandMeasure msrHeaderAlertPage "Update"]
[msrGraphicGroup]
Measure=WebParser
URL=[msrSite]
RegExp=#regexGraphic#
StringIndex=4
[msrGraphic1Icon]
Measure=WebParser
URL=#SiteURL#[msrGraphicGroup]
StringIndex=4
Download=1
IfMatch=(?i)\.gif
IfMatchAction=[!ShowMeter mtrDay1Icon]
IfNotMatchAction=[!HideMeter mtrDay1Icon]