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.

DragnLord's weather script

Support & discussion of released scripts, and announcements of new releases.
Post Reply
b
bluzman
Voice
Posts: 4
Joined: Sat Jan 22, 2011 1:22 pm

Post by bluzman »

@stock : Thank you very much. That works perfectly!
s
streamish
Voice
Posts: 21
Joined: Fri Dec 03, 2010 4:33 pm

fwhat help

Post by streamish »

When I comment out the following code, the script works fine, but it does not print a forecast.

Code: Select all

                regexp {<div class=\"b\">(.*?)</div>(.*?)</td>} $cast match fwhen($f) fwhat($f) 
#               regsub -all {<([^<])*>} $fwhat($f) {} fwhat($f) 
#               regsub -all {[[:cntrl:]]} $fwhat($f) {} fwhat($f) 
#               regsub { » ZIP Code Detail} $fwhat($f) {} fwhat($f) 
#               set fcast($f) "\002$fwhen($f):\002 $fwhat($f)"
However, if I uncomment the lines I get the following errors:

[14:37:27] Tcl error [pub_wz_forecast]: can't read "fwhat(2)": no such element in array

There are no errors in the tcl, and I have no idea what this may be. Can someone please help me out with this.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: fwhat help

Post by speechles »

syllable3 wrote:There are no errors in the tcl, and I have no idea what this may be. Can someone please help me out with this.
Against my better judgement, (mainly because this script is written horrendously and makes my eyes sore) I'll offer you some help.

Code: Select all

                regexp {<div class="b">(.*?)</div>.*?<div>(.*?)</div>} $cast match fwhen($f) fwhat($f)
                regsub -all {<([^<])*>} $fwhat($f) {} fwhat($f)
                regsub -all {[[:cntrl:]]} $fwhat($f) {} fwhat($f)
                regsub { » ZIP Code Detail} $fwhat($f) {} fwhat($f)
                set fcast($f) "\002$fwhen($f):\002 $fwhat($f)"
Your section of code you've shown needs to resemble what I've done above.

Also... Saw this irony on IRC (EFNet/#eggtcl) and seems to relate directly to this exact post....
<stream> http://paste.tclhelp.net/?id=8o6
<@MsMadria> http://xrl.us/bijvvz -> #TCL (16381 bytes)
<simple> stream, without knowing the contents of $forecast, it means little...
<stream> i'd kinda assume it wouldnt matter
<stream> since the error itself is fwhat
<stream> and the only instances of fwhat/fwhen is in that section
<+@thommey> you kinda assume wrong
<stream> yea?
<simple> which is populated via $cast, which is from $forecast
<+@thommey> regexp sets fwhat(2) if and only if it matches on $cast which is in turn based on $forecast
<+@thommey> and obviously, this code depends on it matching
<stream> i see
<simple> you probably also want to "set f 1" each iteration of $cast too
<+@thommey> it's the usual "web scraping fail"
<simple> but i might be wrong about that
<+@thommey> as soon as a website changes its layout, all scripts stop working
<+@thommey> and it's not trivial to fix them
<stream> lemme see if i can find it
<+@thommey> it's almost as complicated as writing them in the first place
<stream> regexp {<div class="tm10 bm15">(.*?)</tbody>} $html match forecast
<stream> would that be it?
<+@thommey> how would I know
<+@thommey> I don't have the website source in front of me, knowing what you want to extract
<stream> ok nigger
quits: stream (stream@wargam.es) (Quit: leaving)
<+@thommey> what the hell
<+@thommey> and once again, I was way too friendly
<Razorback> sounds like gimmie what I want and I'll be nice or else attitude... :/
<+@thommey> but I never said I wouldn't give him what he wants
<+@thommey> I just told him that I need to see the website source
<+@thommey> at least I was trying to.. ;)
<+@thommey> that seems to be a severe insult in his country
<+@thommey> to ask for more information
If you are "stream" from the above quote. You need to watch your f-ing mouth. Ask for help, and don't think anybody will know it's you here. Kinda obvious it is.... lame :roll:
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

That's normally the point where I stop helping them at all... Anyway, using the classic interface of wunderground with prior mentioned fix tends to fix it. It's just a simple case of changing www to classic - simpler than that you just can't get.
s
sharpie1664
Voice
Posts: 28
Joined: Sun Aug 05, 2007 4:44 am

Tcl error [pub_wz]: can't read "citychk": no such

Post by sharpie1664 »

When using Weather v4.2.6 by DragnLord i get this error when doing the .wz command


Tcl error [pub_wz]: can't read "citychk": no such variable
a
aa
Voice
Posts: 3
Joined: Fri Jan 08, 2010 9:12 pm

Re: Tcl error [pub_wz]: can't read "citychk": no s

Post by aa »

sharpie1664 wrote:When using Weather v4.2.6 by DragnLord i get this error when doing the .wz command


Tcl error [pub_wz]: can't read "citychk": no such variable
I too am now getting that message when using a Canadian city. For example if I use .wz vancover ca I used to get the report but now only get the error message.

Any ideas?
a
aa
Voice
Posts: 3
Joined: Fri Jan 08, 2010 9:12 pm

Post by aa »

Judging by the lack of responses one would assume that this script is dead in the water.

Is there another script that offers the same functionality as this one. I liked the 5 day forecast so was hoping for something that works similar.
User avatar
spithash
Master
Posts: 248
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

yes there is, incith-weather is what I use. there's also forecast included.
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
User avatar
Suntop
Voice
Posts: 6
Joined: Fri Dec 19, 2008 6:41 pm

Post by Suntop »

I get this error when I try to use it:

Code: Select all

<^Hawk^> [14:21] Tcl error [pub_wz]: can't read "citychk": no such variable
Anyone know how to fix this?

I tried to add a:

Code: Select all

set citychk "0"
at the beginning, but then i get this instead:

Code: Select all

«14:32:27» <@Suntop> .wz
«14:32:32» -^Hawk^- Sorry, oslo is not listed, check http://classic.wunderground.com/global/NO.html for a city thats close.
And I know Oslo is listed, cause it used to work..
Any ideas is very welcome :)

Yeah, and I made all the changes everyone suggested here..still get this error..
--==> Wizard Suntop <==--
User avatar
Suntop
Voice
Posts: 6
Joined: Fri Dec 19, 2008 6:41 pm

Post by Suntop »

Yeah, and btw, I tried incith-weather too, but it has errors as well...
--==> Wizard Suntop <==--
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Suntop wrote:Yeah, and btw, I tried incith-weather too, but it has errors as well...
<speechles> !wz oslo
<sp33chy> Multiple Results Found: Oslo, Minnesota; Oslo, Norway

<speechles> !wz oslo norway
<sp33chy> speechles's weather request; Oslo, Norway (60.1°N/10.8°E); Updated: 7:34 PM CEST (May 12, 2012); Conditions: Clear; Temperature: 50.4°F (10.2°C); High/Low: 55/42°F (12.8/5.6°C); Humidity: 43%; Dew Point: 29°F (-1.7°C); Pressure: 30.15 in/1021 hPa; Wind: North at 4.0 MPH (6.4 KPH)

<speechles> !fc oslo norway
<sp33chy> speechles's forecast request; Oslo, Norway Forecast (High/Low); Updated: 7:34 PM CEST (May 12, 2012); Saturday: 30% Chance of Rain, 55/42°F (12.8/5.6°C); Sunday: Scattered Clouds, 53/39°F (11.7/3.9°C); Monday: Scattered Clouds, 55/39°F (12.8/3.9°C); Tuesday: 30% Chance of Rain, 53/37°F (11.7/2.8°C); Wednesday: Scattered Clouds, 51/41°F (10.6/5°C)

<speechles> !sky oslo norway
<sp33chy> speechles's sky request; Oslo, Norway Astronomy; Sunrise: 4:44 AM CEST; Sunset: 9:43 PM CEST; Moon: Waning Gibbous (52%); Moonrise: 2:18 AM CEST; Moonset: 11:39 AM CEST; Visible Light: 19h 02m; Daylight Length: 16h 58m; Tomorrow: 4m 49s longer

<speechles> !time oslo norway
<sp33chy> speechles's time request; Oslo, Norway (60.1°N/10.8°E); Local Time: 7:39 PM CEST (May 12, 2012)
I'm unsure where to find the "errors" you talk about, because...the current version of Incith-weather is not found in the TCL Archive. It is found by clicking here. This is the version shown in use above.
V
Vasago
Voice
Posts: 3
Joined: Sun Jan 23, 2011 6:10 pm

Post by Vasago »

speechles wrote:..
Where would one go to keep updated on this incith-weather script?
s
shadrach
Halfop
Posts: 74
Joined: Fri Dec 14, 2007 6:29 pm

Post by shadrach »

Suntop wrote:..
Insert a comma between location and country eg .wz oslo, no. Sudden requirement. Don't know why.
g
goalie204
Halfop
Posts: 44
Joined: Thu Apr 28, 2011 7:31 pm

Post by goalie204 »

script still works fine for me, but super slow to reply from bot, not sure why all of a sudden?
g
gig
Voice
Posts: 3
Joined: Tue Jul 31, 2012 10:05 am
Location: Texas

Post by gig »

Tcl error [pub_wz]: can't read "localdate": no such variable


Not sure what this means if someone can help that'd be great.
Post Reply