View previous topic :: View next topic |
Author |
Message |
planetb Voice
Joined: 21 Jan 2011 Posts: 6
|
Posted: Tue May 23, 2017 5:22 pm Post subject: |
|
|
I got mine working again by commenting out the following section :
# BAROMETER
#if {[regexp -- {"pressure": (.*?),} $html - bar]} {
# regexp -- {barometer : "(.*?)"} $html - cond
# set output(pressure_data) "$bar & $cond"
#}
I dont have time anymore time to play with it before I went to work.
Seems to work :
Planetb's weather request; Glen Burnie, Maryland (39.15999985/-76.62999725); Local Time: 6:52 AM (May 23, 2017); Updated: 42 seconds ago; Temperature: 57.0°F (13.9°C); Feels-like: 57.0°F (13.9°C); High/Low: Unavailable; Humidity: 93%; Wind: WNW |
|
Back to top |
|
 |
simboy1234 Voice
Joined: 16 May 2015 Posts: 5
|
Posted: Wed May 24, 2017 2:20 am Post subject: |
|
|
Thank you very much planetb, that fixed the issue.
Cheers |
|
Back to top |
|
 |
caesar Ass Kicker

Joined: 14 Oct 2001 Posts: 3450 Location: Area 51
|
Posted: Wed May 24, 2017 4:09 am Post subject: |
|
|
Looked at the page source and there's no "barometer" so the cond variable isn't created, hence the error. In order to still get the pressure just replace:
Code: |
# BAROMETER
if {[regexp -- {"pressure": (.*?),} $html - bar]} {
regexp -- {barometer : "(.*?)"} $html - cond
set output(pressure_data) "$bar & $cond"
}
|
with:
Code: |
# BAROMETER
if {[regexp -- {"pressure": (.*?),} $html - bar]} {
set output(pressure_data) "$bar"
}
|
If barometer is temporary missing from the page and want it to be shown when and if will become available again then replace the above code with:
Code: |
if {[regexp -nocase {"pressure": (.*?),} $html - bar]} {
if {[regexp -nocase {"barometer": (.*?),} $html - cond]} {
set output(pressure_data) "$bar & $cond"
} else {
set output(pressure_data) "$bar"
}
}
|
_________________ You may say anything about me, but at least don't misspell my name. xD |
|
Back to top |
|
 |
creasy Voice
Joined: 05 Mar 2016 Posts: 23
|
Posted: Thu Jun 01, 2017 2:59 am Post subject: |
|
|
I'm getting this error now
Code: | Tcl error [incith::weather::weather_handler]: can't read "html(todays_day)": no such element in array |
|
|
Back to top |
|
 |
starryeyedhaze Voice

Joined: 29 Oct 2010 Posts: 4
|
Posted: Fri Jun 23, 2017 11:10 am Post subject: |
|
|
Hi! It looks like wunderground turned off ssl v3 and so I had to change the following:
Code: |
OLD: ::http::register https 443 [list ::tls::socket -request 1 -require 0 -ssl3 1 -tls1 1]
NEW: ::http::register https 443 [list ::tls::socket -request 1 -require 0 -ssl3 0 -tls1 1]
|
|
|
Back to top |
|
 |
rjpearce Voice
Joined: 27 Mar 2006 Posts: 5
|
Posted: Mon Jul 03, 2017 5:55 pm Post subject: |
|
|
It looks to be broken again. I get the following error (with debug=1), does anyone else?
21:45:48 WeatherBabe | [21:45:48] pulling mobile data, missing fc1c, missing fc1d, missing fc1hf, missing windd
21:45:49 WeatherBabe | [21:45:49] Tcl error [incith::weather::weather_handler]: can't read "foutput(fc1hf)": no such element in array
It looks like they have made significant changes to the site again with lots of lovely dynamic content loading.
https://www.wunderground.com/gb/london/zmw:00000.40.03779?MR=1
Looking at the content of the page and guessing the original content the regexes bound to I suspect these regexes need to be updated.
Code: |
#day
set fc_regexp_day {<td class="taC" style="width: 20%;">(.+?)</td>}
#condition
set fc_regexp_cond {<div><img src=".+?\.gif" alt="(.+?)" width="\d\d" height="\d\d" class="condIcon" /></div>}
# high/low
set fc_regexp_highlow {<div class="b nobr"><span style="color: #900;">(.+?)° F</span><span style="font-weight: normal; color: #999;">\|</span><span style="color: #009;">(.+?)° F</span><br />.*?° C.*?° C.*?</div>}
|
I'm currently working on new regexes.
Failing that we could rewrite the script to use the Wunderground API. They are offering free dev account for basic querying. Using that is going to be way way way more reliable than the html. Take a look:
https://www.wunderground.com/weather/api/d/questionnaire.html?plan=a&level=0
https://www.wunderground.com/weather/api/d/docs?MR=1 |
|
Back to top |
|
 |
CP1832 Halfop
Joined: 09 Oct 2014 Posts: 52
|
Posted: Wed Jul 05, 2017 10:53 am Post subject: |
|
|
rjpearce wrote: | It looks to be broken again. I get the following error (with debug=1), does anyone else? | My queries are working just fine, the only part that's broken is the astronomy query, but I don't use it at all. |
|
Back to top |
|
 |
planetb Voice
Joined: 21 Jan 2011 Posts: 6
|
Posted: Thu Sep 07, 2017 8:15 pm Post subject: broke again |
|
|
She's really broke this time. Only seeing the following :
<@Planetb> LJ_'s weather request; High/Low: Unavailable; Wind: West |
|
Back to top |
|
 |
CP1832 Halfop
Joined: 09 Oct 2014 Posts: 52
|
|
Back to top |
|
 |
|