This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

incith:weather (2.8p) (Dec. 18th, 2008)

Support & discussion of released scripts, and announcements of new releases.
Post Reply
p
planetb
Voice
Posts: 6
Joined: Fri Jan 21, 2011 7:10 pm

Post by planetb »

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
s
simboy1234
Voice
Posts: 5
Joined: Sat May 16, 2015 2:06 pm

Post by simboy1234 »

Thank you very much planetb, that fixed the issue.

Cheers
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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: Select all

# BAROMETER
if {[regexp -- {"pressure": (.*?),} $html - bar]} {
 regexp -- {barometer : "(.*?)"} $html - cond
 set output(pressure_data) "$bar & $cond"
} 
with:

Code: Select all

# 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: Select all

if {[regexp -nocase {"pressure": (.*?),} $html - bar]} {
	if {[regexp -nocase {"barometer": (.*?),} $html - cond]} {
		set output(pressure_data) "$bar & $cond"
	} else {
		set output(pressure_data) "$bar"
	}
}
Once the game is over, the king and the pawn go back in the same box.
c
creasy
Voice
Posts: 24
Joined: Sat Mar 05, 2016 4:21 am

Post by creasy »

I'm getting this error now :(

Code: Select all

Tcl error [incith::weather::weather_handler]: can't read "html(todays_day)": no such element in array
User avatar
starryeyedhaze
Voice
Posts: 4
Joined: Fri Oct 29, 2010 2:43 pm

Post by starryeyedhaze »

Hi! It looks like wunderground turned off ssl v3 and so I had to change the following:

Code: Select all

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]
r
rjpearce
Voice
Posts: 5
Joined: Mon Mar 27, 2006 8:36 am

Post by rjpearce »

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/ ... 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: Select all

#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. :roll:

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/ap ... =a&level=0

https://www.wunderground.com/weather/api/d/docs?MR=1
C
CP1832
Halfop
Posts: 68
Joined: Thu Oct 09, 2014 4:03 pm

Post by CP1832 »

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.
p
planetb
Voice
Posts: 6
Joined: Fri Jan 21, 2011 7:10 pm

broke again

Post by planetb »

She's really broke this time. Only seeing the following :

<@Planetb> LJ_'s weather request; High/Low: Unavailable; Wind: West
C
CP1832
Halfop
Posts: 68
Joined: Thu Oct 09, 2014 4:03 pm

Re: broke again

Post by CP1832 »

Yeah, mine's broken too. For what I've seen, wunderground is redirecting from https://www.wunderground.com/cgi-bin/fi ... cow,Russia to https://www.wunderground.com/weather/ru/moscow. However, the script should be going to the mobile site http://mobile.wunderground.com/cgi-bin/ ... cow,Russia but it isn't doing so. Does anyone know to force the script to check the mobile version (which is working AFAIK)?
h
hellohello
Voice
Posts: 12
Joined: Fri Feb 09, 2007 8:12 pm

Post by hellohello »

ok folks, this script seems to be dead in the water... is there an update?
C
CP1832
Halfop
Posts: 68
Joined: Thu Oct 09, 2014 4:03 pm

Post by CP1832 »

hellohello wrote:ok folks, this script seems to be dead in the water... is there an update?
hellohello, check out this script which is working as of now
S
SVD
Voice
Posts: 9
Joined: Mon Mar 13, 2006 6:52 pm

Post by SVD »

I use SpiKe^^'s SayWeather script, which also uses apixu.com's API. Apixu requires your own API key, but it's free. You can sign in using your Google account to get your free key. https://tclarchive.org/view.php?id=1793

In SayWeather, the basic .w command returns a short weather, .wz returns slightly longer, and .wp (or .w+) returns a full weather + forecast. I just remapped the weather plus function to .w so normal calls return everything.
Post Reply