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 

incith:weather (2.8p) (Dec. 18th, 2008)
Goto page Previous  1, 2, 3 ... 17, 18, 19, 20, 21  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Hellster
Voice


Joined: 10 Aug 2006
Posts: 22

PostPosted: Fri May 29, 2015 7:00 am    Post subject: Reply with quote

Many thanks speechles for keeping this script going, if you are coding it, or know who is, please pass along our thanks for keeping it going Smile

PS: just tested it out

Unfortunately not working for me

[8:39pm] <N3W-B0T1> [13:09:36] got temperature 12.9 F
[8:39pm] <N3W-B0T1> [13:09:42] Tcl error [incith::weather::weather_handler]: invalid command name "clock"

I get that in console/partyline and no output to the channel at all Sad
Back to top
View user's profile Send private message
Mysticales
Voice


Joined: 18 Oct 2011
Posts: 26

PostPosted: Sun May 31, 2015 9:47 am    Post subject: Reply with quote

Logged in to say thanks for the update. =) My Channel uses this feature quite a bit. Now I just have to make it less spammy on its output. ^^ hehe.

Is the sky and fc something that may be worked on still? Never used it before, but looks like something that could be nice. =)
_________________
~Battlez-avec la Mystique?~
Back to top
View user's profile Send private message
shadrach
Halfop


Joined: 14 Dec 2007
Posts: 74

PostPosted: Sat Jun 06, 2015 2:09 am    Post subject: Reply with quote

3 day forecast (!fc) appears to be functioning again Confused
Back to top
View user's profile Send private message MSN Messenger
rjpearce
Voice


Joined: 27 Mar 2006
Posts: 5

PostPosted: Sat Jun 13, 2015 8:00 pm    Post subject: Reply with quote

I don't know if this helps but I tried to do some debugging.

I wanted to see if the regex's on line 937 onwards were correct.

(line 937 onwards - focusing entirely on temperature only):
if {[regexp -nocase {data-variable="temperature">} $html]} {
regexp -nocase {"temperature": (.*?),} $html - temp
regexp -nocase {"&deg;(.*?)"} $html - deg
if {[string match "*F*" $deg)]} {

I modified the script to output the entire html to a file.

Using Helsinki, Finland as the test location somewhere inside the giant html
content was the following:

<span class="wx-data" data-station="EFHK" data-variable="temperature"><span class="wx-value">16</span><span class="wx-unit">&deg;C</span></span>

I tried playing around with the regexes but my tcl skills are beyond terrible and I couldn't validate any of them.

Do you think the spans would interfere with the collection of the temperature and unit ?
Back to top
View user's profile Send private message
khalidxpert
Voice


Joined: 26 Jan 2008
Posts: 18

PostPosted: Wed Jun 17, 2015 5:19 am    Post subject: error Reply with quote

hi there

I have installed

# incith:weather v2.8p #
# #
# retrieves weather and forecast data from www.wunderground.com #
# tested on Eggdrop v1.6.18 #


i have getting error
<@A-Guy-From-Heaven> !sky Lahore
<@Yasmin> Lahore, Pakistan Astronomy; Sunrise: Unavailable; Sunset: Unavailable


kinldy suugest

also i am not able to open the site mentioned here

pls. help
Back to top
View user's profile Send private message
SVD
Voice


Joined: 13 Mar 2006
Posts: 9

PostPosted: Fri Jul 10, 2015 3:08 pm    Post subject: Reply with quote

1) Download http://ereader.kiczek.com/incith-weather.tcl
2) Change the "F" on line 942 to "C"
3) Change "C" on line 973 to "F"
4) Change line 1036 to read: regexp -- {data-variable="condition"><span class="wx-value">(.*?)</span>} $html - output(conditions)
Back to top
View user's profile Send private message
bpinard
Voice


Joined: 30 May 2015
Posts: 1

PostPosted: Sat Jul 11, 2015 11:06 pm    Post subject: Reply with quote

Stan wrote:
1) Download http://ereader.kiczek.com/incith-weather.tcl
2) Change the "F" on line 942 to "C"
3) Change "C" on line 973 to "F"
4) Change line 1036 to read: regexp -- {data-variable="condition"><span class="wx-value">(.*?)</span>} $html - output(conditions)


#2 screwed up the temperature readout, and #3 was already set to "F"

#4 fixed the condition output

Thanks for contributing Smile
Back to top
View user's profile Send private message
JJTX
Voice


Joined: 05 May 2015
Posts: 10
Location: United States

PostPosted: Sun Jul 12, 2015 8:14 pm    Post subject: Reply with quote

Awesome to see this script being amended/changed/updated.

Very much appreciated!

( theres nothing else like it )
Back to top
View user's profile Send private message
CP1832
Halfop


Joined: 09 Oct 2014
Posts: 68

PostPosted: Wed Jul 15, 2015 1:29 pm    Post subject: Reply with quote

bpinard wrote:
Stan wrote:
1) Download http://ereader.kiczek.com/incith-weather.tcl
2) Change the "F" on line 942 to "C"
3) Change "C" on line 973 to "F"
4) Change line 1036 to read: regexp -- {data-variable="condition"><span class="wx-value">(.*?)</span>} $html - output(conditions)


#2 screwed up the temperature readout, and #3 was already set to "F"

#4 fixed the condition output

Thanks for contributing Smile
Regarding this, I figured out that the script is misreading the temperatures that are Celsius as Fahrenheit
Quote:
[14:25:46] incith:weather-2.9d: <CP1832/#chat> !weather New York city
[14:25:49] got temperature 24.9 F
So I modified the code to be as below:
Code:
      # TEMPERATURE
      if {[regexp -nocase {data-variable="temperature">} $html]} {
      regexp -nocase {"temperature": (.*?),} $html - temp
      regexp -nocase {"&deg;(.*?)"} $html - deg
         putlog "got temperature $temp $deg"
         if {[string match "*F*" $deg)]} {
          set output(tempc) $temp
          set output(tempf) [format "%.${incith::weather::granularity}f" [expr {9.0/5.0*$output(tempc) + 32.0}]]
          if {[string match *\.* $output(tempf)]} {
      set c [split $output(tempf) .]
      set ot1 [lindex $c 0]
      set ot2 [string trim [lindex $c 1] " 0"]
      if {[string length $ot2]} { set output(tempf) "${ot1}.${ot2}" } { set output(tempf) $ot1 }

          }
        } else {
            set output(tempf) $temp
            set output(tempc) [format "%.${incith::weather::granularity}f" [expr {5.0/9.0*($output(tempf) - 32.0)}]]
            if {[string match *\.* $output(tempc)]} {
          set c [split $output(tempc) .]
      set ot1 [lindex $c 0]
      set ot2 [string trim [lindex $c 1] " 0"]
      if {[string length $ot2]} { set output(tempc) "${ot1}.${ot2}" } { set output(tempc) $ot1 }
          }
        }
      }
      if {[info exists output(tempf)]} {
        set templength [string length $output(tempf)]
        if {$templength > 20} {
          putlog "length fubar"
          set output(error) "Something is fubar! :)"
          return [array get output]
        }
      }

      # FEELS LIKE
      if {[regexp -- {"feelslike": (.*?),} $html - feels]} {
         if {[string match "*F*" $deg)]} {
          set output(windchillc) $feels
          set output(windchillf) [format "%.${incith::weather::granularity}f" [expr {9.0/5.0*$output(windchillc) + 32.0}]]
          if {[string match *\.* $output(windchillf)]} {
      set c [split $output(windchillf) .]
      set ot1 [lindex $c 0]
      set ot2 [string trim [lindex $c 1] " 0"]
      if {[string length $ot2]} { set output(windchillf) "${ot1}.${ot2}" } { set output(windchillf) $ot1 }

          }
        } else {
            set output(windchillf) $feels
            set output(windchillc) [format "%.${incith::weather::granularity}f" [expr {5.0/9.0*($output(windchillf) - 32.0)}]]
            if {[string match *\.* $output(windchillc)]} {
          set c [split $output(windchillc) .]
      set ot1 [lindex $c 0]
      set ot2 [string trim [lindex $c 1] " 0"]
      if {[string length $ot2]} { set output(windchillc) "${ot1}.${ot2}" } { set output(windchillc) $ot1 }
          }
        }
      }
And now the bot displays the temperatures just fine
Quote:
(2015-07-15 14:25:53) BOT: New York, New York (40.75013351/-73.99700928); Updated: 15 seconds ago; Conditions: cld; Temperature: 76.8°F (24.9°C); Feels like: 78.8°F (26°C); High/Low: Unavailable; UV: 1.0/12; Humidity: 83%; Wind: East
Back to top
View user's profile Send private message
shadrach
Halfop


Joined: 14 Dec 2007
Posts: 74

PostPosted: Thu Aug 06, 2015 9:17 am    Post subject: Reply with quote

All requests now returning 'Please refine your search.' Crying or Very sad
Back to top
View user's profile Send private message MSN Messenger
CP1832
Halfop


Joined: 09 Oct 2014
Posts: 68

PostPosted: Thu Aug 06, 2015 10:20 am    Post subject: Reply with quote

shadrach wrote:
All requests now returning 'Please refine your search.' Crying or Very sad
Yes, that happened to me as well. I replaced "http://classic.wunderground.com/cgi-bin/findweather/getForecast?query=" to "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=" and now the script works again.
Back to top
View user's profile Send private message
khalidxpert
Voice


Joined: 26 Jan 2008
Posts: 18

PostPosted: Fri Aug 07, 2015 8:07 am    Post subject: 1) Download http://ereader.kiczek.com/incith-weather.tcl Reply with quote

i have downloded this weather tcl

but its giving an error

<Khaleed> !weather Lahore
<Nikama> Please refine your search.

As per willy
It appears to be working.


Further, this is at the top of the script - perhaps this is useful info for you:

Code:

#---------------------------------------------------------------------#
# incith:weather v2.9c#
# #


but when i downloded i got this version

#---------------------------------------------------------------------#
# incith:weather v2.9d#
# #



kindly provide me the version v2.9.c

thx

Khalid
Back to top
View user's profile Send private message
shadrach
Halfop


Joined: 14 Dec 2007
Posts: 74

PostPosted: Fri Aug 07, 2015 11:58 am    Post subject: Reply with quote

CP1832 wrote:
shadrach wrote:
All requests now returning 'Please refine your search.' Crying or Very sad
Yes, that happened to me as well. I replaced "http://classic.wunderground.com/cgi-bin/findweather/getForecast?query=" to "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=" and now the script works again.


Thanks. I did notice the modified url in the source but i was under the apprehension that script now used the mobile url which is unchanged so I assumed the problem was elsewhere. Embarassed
Back to top
View user's profile Send private message MSN Messenger
webmastir
Voice


Joined: 28 Jan 2011
Posts: 6

PostPosted: Fri Aug 07, 2015 10:03 pm    Post subject: Reply with quote

CP1832 wrote:
shadrach wrote:
All requests now returning 'Please refine your search.' Crying or Very sad
Yes, that happened to me as well. I replaced "http://classic.wunderground.com/cgi-bin/findweather/getForecast?query=" to "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=" and now the script works again.


Worked great - thanks man!
Back to top
View user's profile Send private message
simboy1234
Voice


Joined: 16 May 2015
Posts: 5

PostPosted: Sat Aug 08, 2015 5:39 am    Post subject: Reply with quote

CP1832 wrote:
shadrach wrote:
All requests now returning 'Please refine your search.' Crying or Very sad
Yes, that happened to me as well. I replaced "http://classic.wunderground.com/cgi-bin/findweather/getForecast?query=" to "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=" and now the script works again.


Thank you for the fix, that worked.
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 ... 17, 18, 19, 20, 21  Next
Page 18 of 21

 
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