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 

DragnLord's weather script
Goto page Previous  1, 2, 3 ... 16, 17, 18 ... 22, 23, 24  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
rhn1379
Voice


Joined: 12 Oct 2008
Posts: 5

PostPosted: Thu Oct 16, 2008 1:36 am    Post subject: Reply with quote

DragnLord wrote:
Code:

[Oct_15 3:01:36am] <WZ_Test>  Akron, Ohio -- 3:01 AM EDT Updated: 3:01 AM EDT on October 15, 2008
[Oct_15 3:01:37am] <WZ_Test>  Conditions: 58.4°F / 14.7°C | Overcast
[Oct_15 3:01:38am] <WZ_Test>  Humidity:  88%    Dew Point: 55°F / 13°C
[Oct_15 3:01:40am] <WZ_Test>  Pressure: 30.07in / 1018.2hPa (Falling)  Wind: Calm

The problem is apparently on your end somewhere.


I will make an attempt using a friend's machine, far far away from mine...and see if I get any of the same results...
Back to top
View user's profile Send private message
rhn1379
Voice


Joined: 12 Oct 2008
Posts: 5

PostPosted: Thu Oct 16, 2008 1:51 am    Post subject: Reply with quote

rhn1379 wrote:
DragnLord wrote:
Code:

[Oct_15 3:01:36am] <WZ_Test>  Akron, Ohio -- 3:01 AM EDT Updated: 3:01 AM EDT on October 15, 2008
[Oct_15 3:01:37am] <WZ_Test>  Conditions: 58.4°F / 14.7°C | Overcast
[Oct_15 3:01:38am] <WZ_Test>  Humidity:  88%    Dew Point: 55°F / 13°C
[Oct_15 3:01:40am] <WZ_Test>  Pressure: 30.07in / 1018.2hPa (Falling)  Wind: Calm

The problem is apparently on your end somewhere.


I will make an attempt using a friend's machine, far far away from mine...and see if I get any of the same results...


Ok, this is odd, I was able to get it to work on his machine...LOL.

I use a windrop, he uses an eggdrop. Maybe there's something with Window that's preventing it. Who knows. thank you anyways. Smile
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Oct 16, 2008 8:45 am    Post subject: Reply with quote

The results I showed are from a windrop.
Your problem is specific to your machine.
Back to top
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Tue Nov 11, 2008 1:37 am    Post subject: Reply with quote

rhn1379 wrote:
rhn1379 wrote:
DragnLord wrote:
Code:

[Oct_15 3:01:36am] <WZ_Test>  Akron, Ohio -- 3:01 AM EDT Updated: 3:01 AM EDT on October 15, 2008
[Oct_15 3:01:37am] <WZ_Test>  Conditions: 58.4°F / 14.7°C | Overcast
[Oct_15 3:01:38am] <WZ_Test>  Humidity:  88%    Dew Point: 55°F / 13°C
[Oct_15 3:01:40am] <WZ_Test>  Pressure: 30.07in / 1018.2hPa (Falling)  Wind: Calm

The problem is apparently on your end somewhere.


I will make an attempt using a friend's machine, far far away from mine...and see if I get any of the same results...


Ok, this is odd, I was able to get it to work on his machine...LOL.

I use a windrop, he uses an eggdrop. Maybe there's something with Window that's preventing it. Who knows. thank you anyways. Smile


I have both eggdrop and windrop and it works fine.... I guess you didn't add the required egg http package in the conf
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Tue Nov 11, 2008 3:33 am    Post subject: Reply with quote

cache wrote:

I have both eggdrop and windrop and it works fine.... I guess you didn't add the required egg http package in the conf
No such thing required.
My script is not dependent upon additional packages.
Back to top
View user's profile Send private message
Crow50
Voice


Joined: 03 Jun 2008
Posts: 8

PostPosted: Wed Dec 17, 2008 7:49 pm    Post subject: Variable Error Reply with quote

.wz (zipcode) I get = Tcl error [pub_wz]: can't read "mtemp": no such variable
Back to top
View user's profile Send private message
Moonster
Halfop


Joined: 13 Nov 2002
Posts: 95
Location: Manchester NH USA

PostPosted: Wed Dec 17, 2008 8:43 pm    Post subject: Re: Variable Error Reply with quote

Crow50 wrote:
.wz (zipcode) I get = Tcl error [pub_wz]: can't read "mtemp": no such variable


I am getting the same error. Wonder if they changed the website again.....
_________________
"Knowledge is Power"
BeastNH/Moonster on Undernet/EFnet IRC Network
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Wed Dec 17, 2008 9:54 pm    Post subject: Re: Variable Error Reply with quote

Moonster wrote:
Crow50 wrote:
.wz (zipcode) I get = Tcl error [pub_wz]: can't read "mtemp": no such variable


I am getting the same error. Wonder if they changed the website again.....


Same here
Back to top
View user's profile Send private message
redwolf
Voice


Joined: 26 Jun 2007
Posts: 17

PostPosted: Wed Dec 17, 2008 10:58 pm    Post subject: error Reply with quote

same here, worked last night
Back to top
View user's profile Send private message
redwolf
Voice


Joined: 26 Jun 2007
Posts: 17

PostPosted: Wed Dec 17, 2008 11:10 pm    Post subject: update soon??? Reply with quote

is dragonlord going to update soon?
Back to top
View user's profile Send private message
GrumpyBear
Voice


Joined: 17 Dec 2008
Posts: 3
Location: Care-a-Lot

PostPosted: Thu Dec 18, 2008 10:32 am    Post subject: Reply with quote

hmm, the website he hosted the script on is gone. the domain doesnt even work, and he hasnt posted in over a month... wonder if he is still working on the script...?

and I also am receiving that same error.
Back to top
View user's profile Send private message
GrumpyBear
Voice


Joined: 17 Dec 2008
Posts: 3
Location: Care-a-Lot

PostPosted: Thu Dec 18, 2008 4:58 pm    Post subject: Reply with quote

Does his script take data directly from the webpage? or does it use XML data? cause it seems scripts that extract data using the XML method dont need to be updated to rely on webpage code to work... ???
Back to top
View user's profile Send private message
Yog
Voice


Joined: 18 Dec 2008
Posts: 3

PostPosted: Thu Dec 18, 2008 6:02 pm    Post subject: Reply with quote

The problem appears to be that the script expects the HTML output to include both degrees F and C, but wunderground changed the way this works so that this is now a preference handed to their web site from your browser via cookies.

The script uses it's own method to do the HTTP request, and I couldn't figure out how to successfully include a cookie in the HTTP request. I tried simply outputting "Cookie: Units=both" on the next line after the GET request, but that didn't seem to have an effect. There's probably something that must be done to properly format the HTTP request to make this work, but I didn't have time to work on it.

Hopefully Dragnlord will update this.

@Grumpybear: Yeah, the scripts, all scripts like this really, should be updated to use the api.wunderground.org XML output. SO much easier to parse than HTML output. I'm almost tempted to rewrite the script to use this. Almost. Maybe if I get some time.

@Dragnlord: Check this out: http://wiki.wunderground.com/index.php/API_-_XML
Back to top
View user's profile Send private message
random2
Voice


Joined: 18 Dec 2008
Posts: 5

PostPosted: Thu Dec 18, 2008 8:21 pm    Post subject: Reply with quote

Yes, the website changed. This is why screen scrapers suck.

I've already fixed mine.

I started fixing the regex's and doing the math if the metric equivalents were not provided. Got about halfway done. Also, looked at the mobile version (which has simpler HTML to parse) and the XML api, before realizing how to change it back (the cookie)

Yog, both the mobile version or the cookie fix require a couple more lines of fix. Basically, the current script uses HTTP/0.9. You need at least HTTP/1.0 for either HTTP virtual hosting or cookies.

Here's a sample diff, you'll need to do this in about 3 or 4 places:

Code:

--- weather4.2.4.tcl.orig       2008-05-30 06:00:02.000000000 -0700
+++ weather4.2.4.tcl    2008-12-18 14:16:29.000000000 -0800
@@ -870,7 +887,10 @@
       close $wzsock
       return 0
    }
-   puts $wzsock "GET $pn_url"
+   puts $wzsock "GET $pn_url HTTP/1.0"
+   puts $wzsock "Host: www.wunderground.com"
+   puts $wzsock "Cookie: Units=both"
+   puts $wzsock ""
    flush $wzsock
    while {![eof $wzsock]} {
       set http [gets $wzsock]


I also fixed the weather forecasts, which have been broken for quite some time (in a semi-hacky way that makes international forecasts work as well), and added IATA codes as well as tidy up the ICAO code detector a bit.

The reason I didn't just spend the time to use either the XML or mobile screens is because there is some data not available on those (current time) that I find useful (yea I should get a time script for time, and then I can ditch that). I thought about making two requests, one to get the time, and one to parse the mobile version, but I couldn't bring myself to resort to that inefficiency. And then I found the cookie fix which was quick enough. Also, XML isn't a guarantee of non-breakage either, though there is less for them to change (field names, formats, but not layouts or div tags)

By the way, I noticed this in the headers for weather4.tcl and onward.
Code:

##  Derivative works based on this script (whole or in part) are not allowed.
##  Use murf's 3.4.1 (which he released under GPL) to create your own scripts.


I haven't been able to find any proof of license for murf's script (which I've used since 3.2 back in 2002) in the script or in any of the still-around places . Nor could I find it in the archive of murf's webpage

I have also seen and used Dragnlord's versions since then up through 4 (I decided if i was going to fix 4 today, I might as well fix 4.2.4). I believe that all of Dragnlord's versions are derivative works of murf's, which would make them GPL'd as well. Or, if it wasn't GPL'd, then any derivative work from murf's would be just as not allowed. (disclaimer: I am not a lawyer)
Back to top
View user's profile Send private message
redwolf
Voice


Joined: 26 Jun 2007
Posts: 17

PostPosted: Thu Dec 18, 2008 9:44 pm    Post subject: hmm does anyone have a working script? Reply with quote

i tried that random2 codes, i still get cant find mtemp...
Tcl error [pub_wz]: can't read "mtemp": no such variable
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 ... 16, 17, 18 ... 22, 23, 24  Next
Page 17 of 24

 
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