ddyck;618296 Wrote:
> After two days of frustration, I finally got mine going again based on
> the info in this thread. For me, the fix from Peter didn't solve
> everything. One of the the class tag values for precipitation still
> needed to be changed...from "twc-col-3 twc-line-precip" to "twc-col-3
> twc-line-precip severe-snow-highlight". I hope this
> 'severe-snow-highlight' doesn't start showing up in other places (I
> guess we'll see what happens tomorrow)!
>
> Super useful thread! Thanks!
We had a snow event down here in Kansas last Monday that triggered
weather.com to start putting in some of the modified class tag values.
Besides the early February blizzard I haven't had to deal with
weather.com messing up SDT like you guys have this winter.
Anyway I tweaked the gotWeather sub in my copy of Greg's plugin.pm to
deal with the changing HTML in a slightly different way. I'm hoping it
will be more tolerant when weather.com decides to change the tags back
or to something else all together. I used the "qr" operator to match
on the "core" tag values so it will still find it when they add extra
text to the end of it. (or a space) My modified line from ddyck's
example looks like this.
Code:
--------------------
@matches = $tree->look_down( "_tag", "td", "class", qr{twc-col-3
twc-line-precip} );
--------------------
I have attached a text file of my modified gotWeather sub to this post.
Maybe it will be helpful to others. I went ahead changed several of
the $tree->look_down lines of code trying to head off the next
weather.com html tweak that breaks SDT's scraping routine.
Cheers,
Don
PS - For those of you in the US, I noticed that weather.com starting
changing the estimated 24hr snowfall and precip HTML. However, they
didn't change it for all locations. The attached sub looks for both
formats of this HTML.
+-------------------------------------------------------------------+
|Filename: gotWeather.txt |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=11525|
+-------------------------------------------------------------------+
--
BoomX2
------------------------------------------------------------------------
BoomX2's Profile: http://forums.slimdevices.com/member.php?userid=33529
View this thread: http://forums.slimdevices.com/showthread.php?t=14327
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins