| View previous topic :: View next topic |
| Author |
Message |
bluzman Voice
Joined: 22 Jan 2011 Posts: 4
|
Posted: Thu Feb 03, 2011 8:46 am Post subject: |
|
|
| @stock : Thank you very much. That works perfectly! |
|
| Back to top |
|
 |
streamish Voice
Joined: 03 Dec 2010 Posts: 21
|
Posted: Thu Feb 24, 2011 5:43 pm Post subject: fwhat help |
|
|
When I comment out the following code, the script works fine, but it does not print a forecast.
| Code: | 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. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Feb 25, 2011 3:05 am Post subject: Re: fwhat help |
|
|
| 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: | 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.... | Quote: | <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  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri Feb 25, 2011 8:09 am Post subject: |
|
|
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. _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
sharpie1664 Voice
Joined: 05 Aug 2007 Posts: 28
|
Posted: Mon Oct 17, 2011 6:10 pm Post subject: Tcl error [pub_wz]: can't read "citychk": no such |
|
|
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 |
|
| Back to top |
|
 |
aa Voice
Joined: 08 Jan 2010 Posts: 3
|
Posted: Wed Oct 26, 2011 10:19 am Post subject: Re: Tcl error [pub_wz]: can't read "citychk": no s |
|
|
| 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? |
|
| Back to top |
|
 |
aa Voice
Joined: 08 Jan 2010 Posts: 3
|
Posted: Tue Nov 08, 2011 11:35 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Tue Nov 08, 2011 4:00 pm Post subject: |
|
|
yes there is, incith-weather is what I use. there's also forecast included. _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
Suntop Voice

Joined: 19 Dec 2008 Posts: 6
|
Posted: Sat May 12, 2012 8:38 am Post subject: |
|
|
I get this error when I try to use it:
| Code: | | <^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:
at the beginning, but then i get this instead:
| Code: | «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 <==-- |
|
| Back to top |
|
 |
Suntop Voice

Joined: 19 Dec 2008 Posts: 6
|
Posted: Sat May 12, 2012 8:41 am Post subject: |
|
|
Yeah, and btw, I tried incith-weather too, but it has errors as well... _________________ --==> Wizard Suntop <==-- |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat May 12, 2012 1:41 pm Post subject: |
|
|
| Suntop wrote: | | Yeah, and btw, I tried incith-weather too, but it has errors as well... |
| Quote: | <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. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Vasago Voice
Joined: 23 Jan 2011 Posts: 3
|
Posted: Sat May 12, 2012 3:26 pm Post subject: |
|
|
Where would one go to keep updated on this incith-weather script? |
|
| Back to top |
|
 |
shadrach Halfop
Joined: 14 Dec 2007 Posts: 74
|
Posted: Sat May 12, 2012 6:50 pm Post subject: |
|
|
Insert a comma between location and country eg .wz oslo, no. Sudden requirement. Don't know why. |
|
| Back to top |
|
 |
goalie204 Halfop
Joined: 28 Apr 2011 Posts: 44
|
Posted: Thu May 17, 2012 6:09 am Post subject: |
|
|
| script still works fine for me, but super slow to reply from bot, not sure why all of a sudden? |
|
| Back to top |
|
 |
gig Voice
Joined: 31 Jul 2012 Posts: 3 Location: Texas
|
Posted: Sun Aug 05, 2012 9:45 am Post subject: |
|
|
Tcl error [pub_wz]: can't read "localdate": no such variable
Not sure what this means if someone can help that'd be great. |
|
| Back to top |
|
 |
|