| View previous topic :: View next topic |
| Author |
Message |
gravdigr Voice
Joined: 31 Jan 2011 Posts: 1
|
Posted: Mon Jan 31, 2011 10:31 pm Post subject: Dragonlords weather script |
|
|
i now get "no report" for the temp..i've used your fix on the tcl but it returns an error..if there's any way you could send me the editted weather426.tcl i'd appreciate it..the error is
<GreenWood> [10:54] Tcl error [pub_wz]: can't read "fwhat(2)": no such element in array
wunderground must've changed their website once again..
my shell is running freebsd
thnx again |
|
| Back to top |
|
 |
webmastir Voice
Joined: 28 Jan 2011 Posts: 6
|
Posted: Tue Feb 01, 2011 8:40 am Post subject: Re: Dragonlords weather script |
|
|
| gravdigr wrote: | i now get "no report" for the temp..i've used your fix on the tcl but it returns an error..if there's any way you could send me the editted weather426.tcl i'd appreciate it..the error is
<GreenWood> [10:54] Tcl error [pub_wz]: can't read "fwhat(2)": no such element in array
wunderground must've changed their website once again..
my shell is running freebsd
thnx again |
i edited stuff in 426 w/ the fix & noticed it was still giving no report. so i changed the few entries, listed a couple posts ago, in v *425 & everything started working again
i can post a link to 425's fixed tcl if you want |
|
| Back to top |
|
 |
streamish Voice
Joined: 03 Dec 2010 Posts: 21
|
Posted: Tue Feb 01, 2011 5:54 pm Post subject: |
|
|
Would like to see if I can get a little help on this issue. I've updated the weather script by replacing the °'s with °'s as aforementioned.
| Code: | | ..... {regexp {Temperature: (.*?)°F / (.*?)°C} ....... |
(just a small snippet)
However, upon rehash, it spit out an error about fwhat(1) no such element or whatever it was. So I went and commented out the lines which contained the fwhat.....
| 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)" |
After doing that the script works. But it inserts a question mark for some reason.
| Code: | League City, Texas -- 3:50 PM CST Updated: 3:19 PM CST on February 01, 2011
Conditions: 42.5?F / 5.8?C | Mostly Cloudy Humidity: 66% Windchill: 42?F / 6?C
Sunrise: 7:09 AM CST Sunset: 5:58 PM CST |
Anyone know a fix for this?
Thanks |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Tue Feb 01, 2011 10:21 pm Post subject: |
|
|
| syllable3 wrote: |
After doing that the script works. But it inserts a question mark for some reason.
|
Anything replaced by a ? is a sign that the IRC server you use doesn't support ASCII codes (#deg;). My expirence anyway. |
|
| Back to top |
|
 |
bluzman Voice
Joined: 22 Jan 2011 Posts: 4
|
Posted: Wed Feb 02, 2011 5:17 am Post subject: |
|
|
| Looks like it is broken again. Typing .wz does nothing now. |
|
| Back to top |
|
 |
webmastir Voice
Joined: 28 Jan 2011 Posts: 6
|
Posted: Wed Feb 02, 2011 8:39 am Post subject: |
|
|
| bluzman wrote: | | Looks like it is broken again. Typing .wz does nothing now. |
damn. yep...sure does
| Code: |
[06:38] Tcl error [pub_wz]: can't read "localdate": no such variable
|
|
|
| Back to top |
|
 |
xheliox Voice
Joined: 02 Feb 2011 Posts: 1
|
Posted: Wed Feb 02, 2011 9:17 am Post subject: |
|
|
Just search and replace...
s/www.wunderground.com/classic.wunderground.com
Fixed it for me. |
|
| Back to top |
|
 |
redwolf Voice
Joined: 26 Jun 2007 Posts: 17
|
Posted: Wed Feb 02, 2011 10:55 am Post subject: help |
|
|
s/www.wunderground.com/classic.wunderground.com
what line does that replace and is there more then one????
the localdate error in the tcl |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Wed Feb 02, 2011 11:05 am Post subject: |
|
|
It's TeX syntax (s/String2Match/String2ReplaceMatchWith). He means replace all occurrences of www.wunderground.com with classic.wunderground.com in the script. _________________ http://www.trixarian.net/Projects
Last edited by Trixar_za on Wed Feb 02, 2011 11:08 am; edited 1 time in total |
|
| Back to top |
|
 |
redwolf Voice
Joined: 26 Jun 2007 Posts: 17
|
Posted: Wed Feb 02, 2011 11:06 am Post subject: |
|
|
| ya figured it out fanks |
|
| Back to top |
|
 |
Vasago Voice
Joined: 23 Jan 2011 Posts: 3
|
Posted: Wed Feb 02, 2011 1:31 pm Post subject: |
|
|
| Yeah that's what fixed it for me. |
|
| Back to top |
|
 |
hm2k Halfop

Joined: 11 Sep 2006 Posts: 57 Location: UK
|
Posted: Wed Feb 02, 2011 3:56 pm Post subject: |
|
|
You may find this useful: http://www.hm2k.com/posts/weather-tcl
It's less likely to fail as it uses Google's API rather than trying to parse a website that is subject to change. |
|
| Back to top |
|
 |
webmastir Voice
Joined: 28 Jan 2011 Posts: 6
|
Posted: Wed Feb 02, 2011 7:17 pm Post subject: |
|
|
| hm2k wrote: | You may find this useful: http://www.hm2k.com/posts/weather-tcl
It's less likely to fail as it uses Google's API rather than trying to parse a website that is subject to change. |
aww! very nice. thx for the heads up on that one.  |
|
| Back to top |
|
 |
bluzman Voice
Joined: 22 Jan 2011 Posts: 4
|
Posted: Wed Feb 02, 2011 8:15 pm Post subject: |
|
|
Could someone post or upload a -fixed working- copy of weather426.tcl please? I tried the fix from above. It did not work.
Thanks in advance. |
|
| Back to top |
|
 |
stock Voice
Joined: 25 Oct 2005 Posts: 3
|
Posted: Thu Feb 03, 2011 6:41 am Post subject: |
|
|
| bluzman wrote: | Could someone post or upload a -fixed working- copy of weather426.tcl please? I tried the fix from above. It did not work.
Thanks in advance. |
The following should be working: http://irradiated.org/~stock/weather426.tcl |
|
| Back to top |
|
 |
|