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)"
Against my better judgement, (mainly because this script is written horrendously and makes my eyes sore) I'll offer you some 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.
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)"
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<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
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.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
Code: Select all
<^Hawk^> [14:21] Tcl error [pub_wz]: can't read "citychk": no such variable
Code: Select all
set citychk "0"
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.
Suntop wrote:Yeah, and btw, I tried incith-weather too, but it has errors as well...
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> !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)