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.

incith:weather (2.8p) (Dec. 18th, 2008)

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

cache wrote:Problem trying to get weather for Bristol UK

This is the error I get in Telnet:

[22:43] incith:weather-2.8r: <nck/#chan> .weather Bristol UK
[22:43] Tcl error [incith::weather::weather_handler]: unable to convert date-time string "January</option><option value="2">February</option><option value="3">March</option><option value="4">April</option><option value="5">May</option><option selected="selected" value="6">June</option><option value="7">July</option><option value="8">August</option><option value="9">September</option><option value="10">October</option><option value="11">Novem

Can anyone help? Thank you.
<speechles> !wz Bristol UK
<sp33chy> speechles's weather request; Bristol Airport, United Kingdom (51.4°N/2.7°W); Updated: 9:50 PM BST (June 16, 2012); Conditions: Mostly Cloudy; Temperature: 54°F (12.2°C); High/Low: 59/50°F (15/10°C); UV: 0/16; Humidity: 88%; Dew Point: 50°F (10°C); Pressure: 29.83 in/1010 hPa; Wind: WSW at 16 MPH (26 KPH)
Are you using Incith:Weather 2.9a? This is the version I am using above. This is not the version found of the archive. This is a special egghelp forum edition for those brave enough to wander into this thread and find it. Enjoys :)
Last edited by speechles on Sun Jun 17, 2012 1:33 am, edited 1 time in total.
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

<speechles> !wz Bristol UK
<sp33chy> speechles's weather request; Bristol Airport, United Kingdom (51.4°N/2.7°W); Updated: 9:50 PM BST (June 16, 2012); Conditions: Mostly Cloudy; Temperature: 54°F (12.2°C); High/Low: 59/50°F (15/10°C); UV: 0/16; Humidity: 88%; Dew Point: 50°F (10°C); Pressure: 29.83 in/1010 hPa; Wind: WSW at 16 MPH (26 KPH)
Are you using Incith:Weather 2.9a? This is the version I am using above. This is not the version found of the archive. This is a special egghelp forum edition for those brave enough to wander into this thread and find it. Enjoys :)
Thanks very much, can't believe I missed that.
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Hey

In the set options line break \n turned on is it possible to only have that work for the !forecast bind and disable it with the weather bind also in the !forecast bind were could I add !tweet so it will tweet the forecast
t
trickle
Voice
Posts: 3
Joined: Sat Jun 02, 2012 1:51 am

Search causing bot to flood out

Post by trickle »

Hi. Users in channels I am running the script on have been finding it entertaining to cause my bot to flood out from doing a search for the weather on Uranus. User does the search "!weather Uranus" and the bot starts flooding raw HTML into the channel until it is flooded off the network. Anyone know of a fix?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: Search causing bot to flood out

Post by speechles »

trickle wrote:Hi. Users in channels I am running the script on have been finding it entertaining to cause my bot to flood out from doing a search for the weather on Uranus. User does the search "!weather Uranus" and the bot starts flooding raw HTML into the channel until it is flooded off the network. Anyone know of a fix?
Hmmm... That's a bummer. People will see that and amuse themselves by typing it over and over and having the bot flood the channel. Somebody should probably fix the issue to eliminate bad behavior. Well, looks like they just did.. :)
<speechles> !wz uranus
<sp33chy> speechles's weather request; Uranus, Antarctica (71.4°S/68.8°W); Updated: 8:00 PM EDT (August 05, 2012); Temperature: 6°F (-14.4°C); High/Low: 5/0°F (-15/-17.8°C); Wind: West at 13 MPH (22 KPH)

Code: Select all

#  2.9b: Corrected cruft within updated time.                         #
Get it here: Incith:Weather 2.9b

Enjoys, have fun. Dance like an robot. ;D
g
gig
Voice
Posts: 3
Joined: Tue Jul 31, 2012 10:05 am
Location: Texas

Post by gig »

Can we get rid of the Celsius reporting for those of us in the US somehow?
M
Mysticales
Voice
Posts: 26
Joined: Tue Oct 18, 2011 5:33 pm

Post by Mysticales »

gig wrote:Can we get rid of the Celsius reporting for those of us in the US somehow?
I disagree. In IRC have people from all over the world. I actually like that I dont need to set F or C and instead have both results. Makes it easier for everyone.. since technically USA is the oddball for using F.
~Battlez-avec la Mystique?~
M
MrBenC
Voice
Posts: 4
Joined: Sat Nov 24, 2012 3:36 am

Post by MrBenC »

Note: Because of the post following this one, performing this fix is no longer necessary.

I apologize for my first post to start out this way, but I consider this to be of critical importance. To the point that if this fix is not implemented, you should not run this script.

So, I've discovered a HUGE problem with this script, in version 2.9b.

Reproducing the error is easy.

All one has to do, is type a command like the following:

!weather Canada

Or some other large, vague location with a very large number of towns and cities. As the script is designed to like multiple results, it will proceed to list each and every single town in Canada (or at least try), if you were to use my previous example.

This greatly increases the likelihood the bot will flood itself off of the network. Sure, users should just use the correct commands in the first place, but mistakes can be made, and as everyone knows, there's always people who, upon discovering exploits, will abuse them.


Fortunately, I discovered a way to fix it. Around line 878 or so, you will see the following lines of code:

Code: Select all

        if {[llength [set lr [lsort -unique -increasing $lr]]] == 1} {
          unset output
          array set output [fetch_html "[lindex $lu 0]" "http://classic.wunderground.com" 1]
        } else {
          set output(error) "Multiple Results Found: [join $lr "; "]"
        }
Change it to the following code:

Code: Select all

        if {[llength [set lr [lsort -unique -increasing $lr]]] == 1} {
          unset output
          array set output [fetch_html "[lindex $lu 0]" "http://classic.wunderground.com" 1]
        } else {
          #set output(error) "Multiple Results Found: [join $lr "; "]"
          if {[llength [set lr [lsort -unique -increasing $lr]]] <= 5} {
          	set output(error) "Multiple Results Found: [join $lr "; "]"
          } else {
          	set output(error) "More than five results found, please narrow your search!"
          }
Note that I changed it return an error if more than five results are found. You can change it to 10, or even 20. However, you must make sure there is an upper limit of some sort.

One you change the code, all you have to do is rehash the bot. To test if you implemented the fix correctly, type

!weather Springfield

on IRC. While it will ordinarily return over five results with a script without my fix, it doesn't produce a huge amount of text.


Unless this fix is implemented, I don't recommend running this otherwise very nice script. Allow me to repeat that:

Do not run this script until this fix is implemented!

Edit: I didn't expect such a quick fix. Thank you.
Last edited by MrBenC on Tue Dec 04, 2012 8:05 pm, edited 1 time in total.
Ben
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Rather than get all crazy and make demands of other people, let me explain. This occured because wunderground has changed their markup when multiple results occur. No longer can you tell when the page has a ton of results appear. There used to be markup to indicate it was.

This isn't an emergency. You won't suffer a gunshot wound to the face. Nobody is outside your window waiting to "gut you like a fish". The thing is, most of you would have never noticed. So instead of making some huge deal about it with red text at the beginning and huge bold text at the end. I prefer to just get to the point... A new version... YAY!!

Code: Select all

# what are the maximum amount of locations to show when multiples are given?
variable multiple_result 25
As usual, get the script at its regular location:
Incith:Weather 2.9c

Code: Select all

<speechles> !weather canada
<sp33chy> 583 results found, listing first 25: Abbotsford, British Columbia; Acadia Valley, Alberta; Addenbroke Island, British Columbia; Agassiz, British Columbia; Aklavik, Northwest Territories; Akulivik, Quebec; Alert, Nunavut; Amherst, Nova Scotia; Argentia, Newfoundland; Armstrong, Ontario; Arviat, Nunavut; Assiniboia, Saskatchewan; Atikokan, Ontario; Atlee, Alberta; Aulavik National Park, Northwest
<sp33chy> Territories; Aupaluk, Quebec; Bachelors Island Marine, Manitoba; Bagotville, Quebec; Baie Comeau Airport, Quebec; Baie Comeau, Quebec; Baker Lake, Nunavut; Ballenas Island, British Columbia; Bancroft, Ontario; Banff Airport, Alberta; Banff, Alberta

<speechles> !weather india
<sp33chy> 137 results found, listing first 25: Agartala, India; Agra, India; Ahmedabad, India; Alibag, India; Allahabad, India; Amritsar, India; Anantapur, India; Ariyalur, India; Arrah, India; Atiramapattinam, India; Aurangabad, India; Azamgarh, India; Bagati, India; Bagdogra Airport, India; Balasore, India; Ballia, India; Bangalore Airport, India; Bangalore, India; Bankura, India; Bareilly, India; Belgaum,
[10:28am] <sp33chy> India; Bhira, India; Bhopal, India; Bhubaneswar, India; Bhuj, India
M
MrBenC
Voice
Posts: 4
Joined: Sat Nov 24, 2012 3:36 am

Post by MrBenC »

Sorry for coming off as a bit strong in my last post. I have since edited it to reflect the very prompt reply I received.

Thank you very much for that, by the way. I appreciate it, and I'm sure others do as well.


I guess I figured that someone would eventually start abusing the (now non-existent) loophole. The reason I did what I did, was because I didn't discover this problem on my own. Someone else told me, and even flooded my bot off of the network. Therefore, I figured it would soon become public knowledge.

In retrospect, I probably should have used a PM.
Ben
b
b0RG
Voice
Posts: 1
Joined: Sat Jan 19, 2013 6:18 pm

Require msgcat.tcl 1.5

Post by b0RG »

Hi there speechles. Hope you are well and having a good new year this year!

We have upgraded all our servers to use TCL 8.5, but they have all updated using msgcat.tcl 1.5 rather than 1.4. Is it possible you could made it so this weather script works for 1.5 as well? We can't really go backwards with TCL so I thought I would ask.

So, thank you for your time and as well for this script. It's been used a lot by us. :)
F
FightingNavyman
Voice
Posts: 35
Joined: Tue Jan 18, 2011 12:39 pm

Post by FightingNavyman »

How do I make this script to show likethis:

http://pastebin.com/K2bP23r5

chicken is using mirc scripting and boobsbot is using incith-weather 2.9c
a
arkadio
Voice
Posts: 6
Joined: Fri Dec 13, 2013 7:36 am

Post by arkadio »

Hi there, Idk if you still maintaining this script but suddenly a few cities started to show strange:

[09:55] <+arkadio> !tempo erechim
[09:55] <Toma_Bebic> Erechim, Brazil; Atualizado: 22:00 BRST (December 12, 2013); Condições: </div></td></tr></table><table cellspacing="0" cellpadding="0" class="dataTable"><tbody><tr><td>Temperature:</td><td class="full b"><span class="pwsrt" pwsid="" pwsunit="both" pwsvariable="tempf" english="°F" metric="°C" value=""> -</span></td></tr><tr><td>Windchill:</td><td> -</td></tr><tr><td>Wind:</td><td
[09:56] <Toma_Bebic> class="full b"><span class="pwsrt" pwsid="" pwsunit="both" pwsvariable="windspeedmph" english="mph" metric="km/h">Calm</span><div id="condboxWindDiv"><img src="http://icons-ak.wxug.com/graphics/360arrows_blue.gif" alt="" id="condboxArrowDiv" />; Temperatura: 2.0°C (35.6°F); Sensação térmica: 4.0°C (2.0°F); Vento: Calm

[09:33] <Thyago> !tempo quirinopolis
[09:33] <+Toma_Bebic> Quirinopolis, Brazil; Atualizado: 22:00 BRST (December 12, 2013); Condições: </div></td></tr></table><table cellspacing="0" cellpadding="0" class="dataTable"><tbody><tr><td>Temperature:</td><td class="full b"><span class="pwsrt" pwsid="" pwsunit="both" pwsvariable="tempf" english="°F" metric="°C" value=""> -</span></td></tr><tr><td>Windchill:</td><td> -</td></tr><tr><td>Wind:</td><td
[09:33] <+Toma_Bebic> class="full b"><span class="pwsrt" pwsid="" pwsunit="both" pwsvariable="windspeedmph" english="mph" metric="km/h">Calm</span><div id="condboxWindDiv"><img src="http://icons-ak.wxug.com/graphics/360arrows_blue.gif" alt="" id="condboxArrowDiv" />; Temperatura: 6.0°C (42.8°F); Sensação térmica: 10.0°C (6.0°F); Vento: Calm
User avatar
play4free2
Voice
Posts: 34
Joined: Sat Nov 23, 2013 1:42 am
Contact:

Post by play4free2 »

arkadio

I run this same script on my bot, when I saw your post I checked the cities you tried and got the same result. I also checked the website "classic.wunderground.com" and for the cities you posted the website showed station not reporting. I just rechecked both and it's now working on the bot and I checked the website and it shows the weather instead of station not reporting.

Hope this helps
Image
420-HIGHTIMES IRC Network
a
arkadio
Voice
Posts: 6
Joined: Fri Dec 13, 2013 7:36 am

Post by arkadio »

yes, crazy, working like a charm now.
Post Reply