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 

Weather script for wetter.com [German]
Goto page Previous  1, 2, 3 ... , 13, 14, 15  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri Jun 06, 2008 6:26 pm    Post subject: Reply with quote

Also sofort werd ich da ungern ran gehen, da die Seite selbst ja noch im Betastatus ist. Wer weiß was sich da noch ändert. Ansonsten will ich net versprechen, dass es eine geben wird, aber ich werd mir das auf jeden Fall mal anschauen und wenn sich das schnell genug hinbiegen lässt, wie ich Zeit dazu finde, dann wirds auch eine neue Version geben von mir.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
Hottihotte
Voice


Joined: 27 Jun 2006
Posts: 23

PostPosted: Sat Jun 07, 2008 1:41 pm    Post subject: Reply with quote

ich bekomme bei der beta folgende fehlermeldung

im channel
-Angel- Fehler vom Webserver: location http://de.beta.wetter.com/wetter_aktuell/wettervorhersage/3_tagesvorhersage/?id=DE0011435001 content-type text/html content-length 0 date {Sat, 07 Jun 2008 17:38:38 GMT} server www-4 x-cache {MISS from webcache-4.wetter.com} x-cache-lookup {MISS from webcache-4.wetter.com:80} via {1.0 webcache-4.wetter.com (squid/3.0.STABLE4)} connection close.

in der partyline
Egghttp2 warning: Server returned unsupported and unrequested charset ''. Parsing stream as 'iso8859-1'
|19:38:42| -Angel- Fehler vom Webserver: location http://de.beta.wetter.com/wetter_aktuell/wettervorhersage/3_tagesvorhersage/?id=DE0011435001 content-type text/html content-length 0 date {Sat, 07 Jun 2008 17:38:38 GMT} server www-4 x-cache {MISS from webcache-4.wetter.com} x-cache-lookup {MISS from webcache-4.wetter.com:80} via {1.0 webcache-4.wetter.com (squid/3.0.STABLE4)} connection close.
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sat Jun 07, 2008 1:51 pm    Post subject: Reply with quote

Das ist die Meldung der wir es gerade hatten. Der arme Bot wird durch die derzeit geschaltete Weiterleitung total verwirrt. Ich will da eigentlich erst was machen, wenn diese Weiterleitung nicht mehr besteht.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
Hottihotte
Voice


Joined: 27 Jun 2006
Posts: 23

PostPosted: Sat Jun 07, 2008 2:18 pm    Post subject: Reply with quote

bei der vorgängerversion bekomme ich den fehler

Angel- Fehler beim Parsen der Wetterseite auf www.wetter.com für '14542'.
Back to top
View user's profile Send private message
shivaz
Voice


Joined: 07 Jun 2008
Posts: 6

PostPosted: Sat Jun 07, 2008 3:48 pm    Post subject: wuahhh Reply with quote

dachte schon ich bin der einzigste mit dem problem...glück gehabt.
hoffentlich gibts baldmöglichst ne neue funzzende version.

danke an den entwickler, hat bisher beste dienste geleistet.

gruss & noch ein schönes weekend
Back to top
View user's profile Send private message
Hottihotte
Voice


Joined: 27 Jun 2006
Posts: 23

PostPosted: Fri Jun 20, 2008 4:36 pm    Post subject: Reply with quote

gibt es denn schon aussicht auf ein funktionierendes script? Sad
Back to top
View user's profile Send private message
baldhead
Voice


Joined: 21 Mar 2008
Posts: 2

PostPosted: Thu Jun 26, 2008 1:08 pm    Post subject: Reply with quote

Hottihotte wrote:
gibt es denn schon aussicht auf ein funktionierendes script? Sad


offensichtlich nicht mehr . . . .

Sad
Back to top
View user's profile Send private message
Hottihotte
Voice


Joined: 27 Jun 2006
Posts: 23

PostPosted: Mon Jul 07, 2008 4:09 am    Post subject: Reply with quote

@de kus

gibt es noch support oder nicht mehr? Sad
Back to top
View user's profile Send private message
Cardinal
Voice


Joined: 24 Jan 2006
Posts: 19

PostPosted: Wed Jul 30, 2008 5:11 am    Post subject: Reply with quote

Ich habe mal versucht das selber zu fixen, aber ich steige bei dem ID System von Wetter.com schon überhaupt nicht durch :s

Würde mich freuen wenn De Kus da nochmal Zeit und Lust für findet.
Back to top
View user's profile Send private message
Hottihotte
Voice


Joined: 27 Jun 2006
Posts: 23

PostPosted: Mon Aug 11, 2008 8:22 am    Post subject: Reply with quote

Cardinal wrote:
Würde mich freuen wenn De Kus da nochmal Zeit und Lust für findet.


da schließe ich mich an Rolling Eyes
Back to top
View user's profile Send private message
Sebastian2
Voice


Joined: 18 Oct 2008
Posts: 1

PostPosted: Sat Oct 18, 2008 11:30 am    Post subject: Reply with quote

Gibt es schon was neues zum Thema?
Back to top
View user's profile Send private message
Hottihotte
Voice


Joined: 27 Jun 2006
Posts: 23

PostPosted: Thu Oct 30, 2008 8:22 pm    Post subject: Reply with quote

nun bekomme ich als fehler

Code:
Fehler vom Webserver: etag {"d65310beb378828916b842c4af0730a2"} content-type {text/html; charset=iso-8859-1} cache-control {public, max-age=300, must-revalidate} expires {Fri, 31 Oct 2008 00:23:33 GMT} last-modified {Fri, 31 Oct 2008 00:18:33 GMT} location http://www.wetter.com/deutschland/werder/bliesendorf/DE0011435001.html content-length 0 date {Fri, 31 Oct 2008 00:21:07 GMT} server www-8 x-cache {MISS from webcache-4.wetter.com} x-cache-lo
Back to top
View user's profile Send private message
shivaz
Voice


Joined: 07 Jun 2008
Posts: 6

PostPosted: Wed Nov 19, 2008 5:28 pm    Post subject: Reply with quote

sooo ich nochmal,

de-kus..kannst du wenigstens sagen ob du dich nochmal drum kümmerst?
wäre nett wenn du ne antwort schreibst.

eigentlich bist du sowas wie die "einzigste chance"
was vernünftiges auf die beine zu stellen.
leider kann ich es nicht Sad

grüsse aus dem süden deutschlands und vorweg ein schönes weekend.

sHiVaZ
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri Feb 13, 2009 3:39 am    Post subject: Reply with quote

Prinzipiel könnte man sich zwar mittlerweile drum kümmern, da glaub diese EM-Weiterleitung oder was das war nimmer geschaltet ist, aber derzeit komm ich einfach nicht dazu und kann auch net versprechen, wann das mal kommen könnte.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
shivaz
Voice


Joined: 07 Jun 2008
Posts: 6

PostPosted: Sat Nov 14, 2009 8:45 pm    Post subject: Reply with quote

Es ist zwar nicht mal ansatzweise mit dem geilen Script von DE KUS zu vergleichen, aber nach Ewigkeit mal besser als nichts.

1. Wetter-Script via Google-Wetter (!wetter PLZ/ORT)
Beispiel: !wetter 70173 (Stuttgart)
Ausgabe:"<@tH3Br4In> Wetter für Stuttgart, BW (70173) - Temp: 9 °C - Wind: SW mit Windgeschwindigkeiten von 19 km/h - Feuchtigkeit: 76 % - Klar"



Code:
package require http
bind pub - !wetter L:wetter
proc L:wetter {nick host hand chan arg} {
   set webstring

"http://www.google.de/ig/api?weather=[lrange $arg 0 end]"
   catch {exec wget -O scripts/wetter.data $webstring} err
   set fp [open

"scripts/wetter.data" r]; set wetterdata [read $fp]; close $fp
   regexp {(?i)<city data=\"(.*?)\"/>} $wetterdata -> wetter(stadt)
   regexp

{(?i)<postal_code data=\"(.*?)\"/>} $wetterdata -> wetter(plz)
   regexp {(?i)temp_c data=\"(.*?)\"/>} $wetterdata -> wetter(current_celsius)
   

regexp {(?i)humidity data=\"(.*?)\"/>} $wetterdata -> wetter(current_feuchtigkeit)
   regexp {(?i)wind_condition data=\"(.*?)\"/>} $wetterdata

-> wetter(current_wind)
   regexp {(?i)condition data=\"(.*?)\"/>} $wetterdata -> wetter(current_weather)
   if {$wetter(current_weather) == ""} {

set wetter(current_weather) "Aktuelle Wetterlage unklar" }
   putserv "privmsg $chan :Wetter für $wetter(stadt) \($wetter(plz)\) - Temp:

$wetter(current_celsius) °C - $wetter(current_wind) - $wetter(current_feuchtigkeit) - $wetter(current_weather) - Mehr Wetter: \002www.wetter.ozon.nu\002 "
}
putlog "GoogleWeather loaded"



2. Eines was noch weniger ausgibt, via wetter.com und benötigt auch noch TCL 8.5 (!wetter PLZ/ORT)
Beispiel: !wetter 70173 (Stuttgart) - Ausgabe: "<@ShAkTi> sHiVaZ: heute wird das Wetter in 70173 wolkig bei 7° Celsius."
Hier kann aber mit z.b. "!wetter <PLZ/ORT> <1-10>" Zehn Tage Vorhersage abgefragt werden.


Code:

# wetter.tcl for eggdrop 1.0-alpha1 version by alexex

# Copyright (C) 2009 alexex

# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any
# later version.

# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

# You should have received a copy of the GNU General Public License along with this program; if not, see
# http://www.gnu.org/licenses/ .


# wetter script für deutschland, österreich & schweiz

namespace eval wetter {

   # With this variable you can change the command on which the weather is gonna be checked.   
   variable bind "?wetter"

   package require http
package require Tcl 8.5

   http::config -useragent "Mozilla/5.0 (compatible; Konqueror/4.3; Linux) KHTML/4.3.2 (like Gecko)"

   # Gets id of the most likely place for input, if it returns 0, nothing was found.
   proc place {input} {
      set url "http://www.wetter.com/suche/?search=[http::formatQuery $input]"
      set token [http::geturl $url]
      upvar #0 $token state
      set i [lsearch $state(meta) "Location"]
      if {$i == -1} {
         set data [http::data $token]
         if {![regexp {<a class="search_result" href="http://www.wetter.com/deutschland/.*?/(.*?).html" target="_top">} $data -> id]} {
            set id 0
         }
      } else {
         incr i
         regexp {.*/(.*?).html} [lindex $state(meta) $i] -> id
      }
      return $id
   }

   # Checks for weather for place on day, where place is the return of place, and day, is either today, tomorrow or count of days.
   proc check {place day} {
      set url "http://www.wetter.com/wetter_aktuell/wettervorhersage/16_tagesvorhersage/?id=$place"
      set data [http::data [http::geturl $url]]
      switch $day {
         "today" {set day [clock format [clock seconds] -format %A -locale de_DE]}
         "tomorrow" {set day [clock format [clock add [clock seconds] 1 days] -format %A -locale de_DE]}
         default {
            if {![string is digit $day] || $day > 11 || $day < 0} {set day 0}
            set day [clock format [clock add [clock seconds] $day days] -format %A -locale de_DE]
         }
      }
      regexp [subst -nocommands {<td class="fc_title fc_center">.*?$day.*?<td class="fc_sub_title fc_center">(.*?)</td>.*?<span class="temp">(.*?)</span>}] $data -> mood temp
      set mood [string trim $mood [list " " "   " \n]]
      return [list $mood $temp]
   }

   bind pub - $bind [namespace current]::pub

   proc pub {nick uhost handle channel text} {
      # TODO: Check when its needed and initialize it then.
      variable bind
      if {[llength $text] == 0} {
         putserv "PRIVMSG $channel :Das war ein bisschen zu wenig Info $nick, wie wärs mit '$bind <ort/plz>'?"
         return 0
      } elseif {[llength $text] == 1} {
         set day 0
         set out "heute"
         set place $text
      } else {
         set last [lindex $text end]
         if {[string equal $last "heute"]} {
            set day 0
            set out "heute"
            set place [join [lrange [split $text] 0 end-1]]
         } elseif {[string equal $last "morgen"]} {
            set day 1
            set out "morgen"
            set place [join [lrange [split $text] 0 end-1]]
         } elseif {[string is integer $last]} {
            if {$last < 0 || $last > 10} {
               putserv "PRIVMSG $channel :Soweit kann ich nicht in die Zukunft/Vergangenheit schauen, versuchs mal mit einer Zahl zwischen 0 und 10 $nick."
               return 0
            } else {
               set day $last
               set out "in $day Tagen"
               set place [join [lrange [split $text] 0 end-1]]
            }
         } else {
            set place $text
            set day 0
            set out "heute"
         }
      }
      if {[set id [place $place]] == 0} {
         putserv "PRIVMSG $channel :Tut mir leid $nick, zu deiner Suche nach '$place' wurde nichts gefunden. Versuchs mal mit was anderem."
         return 0
      } else {
         set forecast [check $id $day]
         putserv "PRIVMSG $channel :$nick: $out wird das Wetter in $place [lindex $forecast 0] bei [lindex $forecast 1]° Celsius."
         return 1
      }
   }

}



ich tendire zum ersten, das ist zumindest mal annehmbar....

ich hoffe und warte immer noch auf DE KUS Wink


Last edited by shivaz on Mon Nov 16, 2009 11:27 am; edited 2 times in total
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 ... , 13, 14, 15  Next
Page 14 of 15

 
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