I have seen several post on the forum that correct other skins that use YAHOO WEATHER as the source (Mond, Lumiero, etc.) and thought I would post the RegExp I developed to collect ALL current data.
Here is the RegExp:
Code: Select all
RegExp=(?siU).*<time class=.*, (.*)</time>.*<div class="My\(2px\).*60x60\/(.*).png.*<p class=.*>(.*)</p>.*class="temperature-forecast .*> <span class=.*>(.*)</span><span class=.*>(.*)</span>.*<tr class=.*forecast-item.*</button>(.*)<.*alt=(.*)>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<div id=module-weather-precipitation.*scope=col>(.*)<.*scope=col>(.*)<.*scope=col>(.*)<.*scope=col>(.*)<.*Fz\(1rem\)">(.*)<.*Fz\(1rem\)">(.*)<.*Fz\(1rem\)">(.*)<.*Fz\(1rem\)">(.*)<.*<div id=module-weather-wind-pressure.*<dd class=.*>(.*)<.*<dd class=.*>(.*)<.*<dd class=.*>(.*)<.*<dd class=.*>(.*)<.*<div id=module-weather-details.*<img class=.*60x60\/(.*).png.*<dd class=.*">(.*)&.*</dd><dd class=.*>(.*)&.*</dd>.*<dd>(.*)</dd>.*<dd.*>(.*)</dd>.*<dd.*>(.*)</dd>.*<dd>(.*)</dd>.*<p class=.*>(.*)</p>.*<p class=.*>(.*)</p>.*<div id=module-weather-sun-moon.*<dd>(.*)</dd>.*<time class=.*>(.*)</time><time class=.*>(.*)</time>.*data-meta='.*"city":"(.*)".*"county":"(.*)".*"state":"(.*)".*"country":"(.*)".*"lat":(.*),.*"lon":(.*),
Code: Select all
Site: WWW.YAHOO.COM/NEWS/WEATHER/
INDEX => DATA MEASURENAME
1 => 12:52 PM .CurrentObservationTime
2 => clear_day@2x .CurrentIcon
3 => Sunny .CurrentConditions
4 => 48 .CurrentTemperatureF
5 => 9 .CurrentTemperatureC
6 => Tuesday .TodayDayName
7 => "Mostly Cloudy" .TodayConditions
8 => 0% .TodayPrecipitationPercent
9 => 55° .TodayHighTemperatureF
10 => 13° .TodayHighTemperatureC
11 => 48° .TodayLowTemperatureF
12 => 9° .TodayLowTemperatureC
13 => Afternoon .TodayPrecipitationFirstLabel
14 => Evening .TodayPrecipitationSecondLabel
15 => Night .TodayPrecipitationThirdLabel
16 => Overnight .TodayPrecipitationFourthLabel
17 => 13% .TodayPrecipitationPercentFirst
18 => 19% .TodayPrecipitationPercentSecond
19 => 47% .TodayPrecipitationPercentThird
20 => 51% .TodayPrecipitationPercentFourth
21 => 6 mph SSE .TodayWindSpeedF
22 => 10 km/h SSE .TodayWindSpeedC
23 => 30.0 inches .TodayPressureF
24 => 1016.9 millibars .TodayPressureC
25 => clear_day@2x .TodayIcon
26 => 52 .TodayFeelsLikeF
27 => 12 .TodayFeelsLikeC
28 => 55% .TodayHumidity
29 => 12.99 miles .TodayVisibilityDistanceF
30 => 20.90 km .TodayVisibilityDistanceC
31 => 3 (Moderate) .TodayUVIndex
32 => Narrative .TodayDayNarrative
33 => Narrative .TodayNightNarrative
34 => Waning Crescent .TodayMoonPhase
35 => 7:25 AM .TodaySunriseTime
36 => 6:01 PM .TodaySunsetTime
37 => Oberlin .LocationName
38 => Lorain .LocationObservation
39 => Ohio .LocationRegion
40 => United States .LocationCountry
41 => 41.28767 .LocationLatitude
42 => -82.239487 .LocationLongitude
** Note that for Icons, Conditions, and Temperatures you will need to substitution to clean up your displayed info.
While I was doing the update, I also created a RegExp to capture the 10-day forecast. Here is the RegExp:
Code: Select all
RegExp=(?siU).*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<tr class=.*forecast-item.*</button>(.*)<.*<img class=.*60x60\/(.*).png.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>.*<dd class=".*">(.*)</dd>
Code: Select all
; Returns for each day: (7 Indexes X 10 days = 70 StringIndexes)
INDEX => DESCRIPTION => DATA FORMAT
1 => Day Name => Sunday
2 => Condition => "Partly Cloudy"
3 => Precip Percent => 0%
4 => High F => 45°
5 => High C => 8°
6 => Low F => 45°
7 =>Low C => 8°
Scraping websites is not a reliable source for data due to the fact that most websites do annual/semi-annual updates to their code that will break this method.
Hopefully this info may help you if you need to use YAHOO WEATHER. I would recommend skins that parse the JSON data (use weather.com as the source) as they are a bit more reliable.