mIRC Home    About    Download    Register    News    Help

Print Thread
weather #58419 30/10/03 11:04 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
ok when ever i try to run this it gets pissy at me and wont open the socket....

and any other tips and pointers to make this more simple would be very nice grin

Code:
alias getweather { sockopen weather www.weather.com 80 }

on *:sockopen:weather: { 
  sockwrite -n weather GET /weather/local/ $+ %weather.zip.town  $+ ?lswe= $+ %weather.zip.town  $+ &lwsa=WeatherLocalUndeclared HTTP/1.0
  sockwrite -n weather Host: www.weather.com 
  sockwrite -n weather Connection: close
  sockwrite -n weather 
  echo Connecting to sock
}
on *:scokread:weather: {
  var %temp 
  sockread %temp
  if CLASS=obsInfo2><B CLASS=obsTextA> isin %temp {
    set %display.1 1
  }
  if %display.1 {
    if $regex(%temp,/color=black>([^<]+)/g) {
      var %i = 1
      while $regml(%i) {
        set $weather.condition $nohtml($ifmatch) $+ $crlf
        inc %i
      }
    }
    if </B></TD> isin %temp {
      unset %display.1
    }
  }
  if (%weather.short $+ 1.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\1.png
  }
  elseif (%weather.short $+ 2.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\2.png
  }
  elseif (%weather.short $+ 3.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\3.png
  }
  elseif (%weather.short $+ 4.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\4.png
  }
  elseif (%weather.short $+ 5.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\5.png
  }
  elseif (%weather.short $+ 6.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\6.png
  }
  elseif (%weather.short $+ 7.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\7.png
  }
  elseif (%weather.short $+ 8.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\8.png
  }
  elseif (%weather.short $+ 9.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\9.png
  }
  elseif (%weather.short $+ 10.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\10.png
  }
  elseif (%weather.short $+ 11.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\11.png
  }
  elseif (%weather.short $+ 12.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\12.png
  }
  elseif (%weather.short $+ 13.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\13.png
  }
  elseif (%weather.short $+ 14.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\14.png
  }
  elseif (%weather.short $+ 15.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\15.png
  }
  elseif (%weather.short $+ 16.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\16.png
  }
  elseif (%weather.short $+ 17.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\17.png
  }
  elseif (%weather.short $+ 18.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\18.png
  }
  elseif (%weather.short $+ 19.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\19.png
  }
  elseif (%weather.short $+ 20.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\20.png
  }
  elseif (%weather.short $+ 21.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\21.png
  }
  elseif (%weather.short $+ 22.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\22.png
  }
  elseif (%weather.short $+ 23.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\23.png
  }
  elseif (%weather.short $+ 24.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\24.png
  }
  elseif (%weather.short $+ 25.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\25.png
  }
  elseif (%weather.short $+ 26.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\26.png
  }
  elseif (%weather.short $+ 27.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\27.png
  }
  elseif (%weather.short $+ 28.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\28.png
  }
  elseif (%weather.short $+ 29.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\29.png
  }
  elseif (%weather.short $+ 30.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\30.png
  }
  elseif (%weather.short $+ 31.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\31.png
  }
  elseif (%weather.short $+ 32.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\32.png
  }
  elseif (%weather.short $+ 33.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\33.png
  }
  elseif (%weather.short $+ 34.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\34.png
  }
  elseif (%weather.short $+ 35.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\35.png
  }
  elseif (%weather.short $+ 36.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\36.png
  }
  elseif (%weather.short $+ 37.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\37.png
  }
  elseif (%weather.short $+ 38.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\38.png
  }
  elseif (%weather.short $+ 39.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\39.png
  }
  elseif (%weather.short $+ 40.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\40.png
  }
  elseif (%weather.short $+ 41.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\25.png
  }
  elseif (%weather.short $+ 42.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\42.png
  }
  elseif (%weather.short $+ 43.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\43.png
  }
  elseif (%weather.short $+ 44.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\44.png
  }
  elseif (%weather.short $+ 45.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\45.png
  }
  elseif (%weather.short $+ 46.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\46.png
  }
  elseif (%weather.short $+ 47.gif isin %temp) {
    set %weather.pic $mircdirimages\icons\47.png
  }
}



Need amazing web design for low price: http://www.matrixn3t.net
Re: weather #58420 30/10/03 02:20 PM
Joined: Jan 2003
Posts: 45
R
rela Offline
Ameglian cow
Offline
Ameglian cow
R
Joined: Jan 2003
Posts: 45
on *: scokread :weather:


@#botwars @Kreynet
Re: weather #58421 30/10/03 02:23 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
sockopen weather www.weather.com
remove the www.


new username: tidy_trax
Re: weather #58422 30/10/03 04:25 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
The www is irrelevant


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: weather #58423 30/10/03 04:25 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
ok


new username: tidy_trax
Re: weather #58424 30/10/03 10:26 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
umm for some reason its still not staying connected =/ every time i try to do /getweather it says it connects
but when i type /socklist it says:
-
* No open sockets
-


Need amazing web design for low price: http://www.matrixn3t.net
Re: weather #58425 31/10/03 04:12 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
try what rela said also: change on *:scokread:..:{ to on *:sockread


new username: tidy_trax
Re: weather #58426 01/11/03 01:15 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
i did... =P


Need amazing web design for low price: http://www.matrixn3t.net