egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

incith:weather (2.8p) (Dec. 18th, 2008)
Goto page Previous  1, 2, 3 ... 19, 20, 21
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
planetb
Voice


Joined: 21 Jan 2011
Posts: 6

PostPosted: Tue May 23, 2017 5:22 pm    Post subject: Reply with quote

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.0F (13.9C); Feels-like: 57.0F (13.9C); High/Low: Unavailable; Humidity: 93%; Wind: WNW
Back to top
View user's profile Send private message
simboy1234
Voice


Joined: 16 May 2015
Posts: 5

PostPosted: Wed May 24, 2017 2:20 am    Post subject: Reply with quote

Thank you very much planetb, that fixed the issue.

Cheers
Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3403
Location: Area 51

PostPosted: Wed May 24, 2017 4:09 am    Post subject: Reply with quote

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 don't misspell my name.
Back to top
View user's profile Send private message
creasy
Voice


Joined: 05 Mar 2016
Posts: 19

PostPosted: Thu Jun 01, 2017 2:59 am    Post subject: Reply with quote

I'm getting this error now Sad
Code:
Tcl error [incith::weather::weather_handler]: can't read "html(todays_day)": no such element in array
Back to top
View user's profile Send private message
starryeyedhaze
Voice


Joined: 29 Oct 2010
Posts: 4

PostPosted: Fri Jun 23, 2017 11:10 am    Post subject: Reply with quote

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
View user's profile Send private message
rjpearce
Voice


Joined: 27 Mar 2006
Posts: 5

PostPosted: Mon Jul 03, 2017 5:55 pm    Post subject: Reply with quote

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;">(.+?)&deg; F</span><span style="font-weight: normal; color: #999;">\|</span><span style="color: #009;">(.+?)&deg; F</span><br />.*?&deg; C.*?&deg; C.*?</div>}



I'm currently working on new regexes. Rolling Eyes

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
View user's profile Send private message
CP1832
Halfop


Joined: 09 Oct 2014
Posts: 49

PostPosted: Wed Jul 05, 2017 10:53 am    Post subject: Reply with quote

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
View user's profile Send private message
planetb
Voice


Joined: 21 Jan 2011
Posts: 6

PostPosted: Thu Sep 07, 2017 8:15 pm    Post subject: broke again Reply with quote

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

<@Planetb> LJ_'s weather request; High/Low: Unavailable; Wind: West
Back to top
View user's profile Send private message
CP1832
Halfop


Joined: 09 Oct 2014
Posts: 49

PostPosted: Thu Oct 05, 2017 12:20 pm    Post subject: Re: broke again Reply with quote

Yeah, mine's broken too. For what I've seen, wunderground is redirecting from https://www.wunderground.com/cgi-bin/findweather/getForecast?query=Moscow,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/findweather/getForecast?brand=mobile&query=Moscow,Russia but it isn't doing so. Does anyone know to force the script to check the mobile version (which is working AFAIK)?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3 ... 19, 20, 21
Page 21 of 21

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber