Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:TEXT:*:#: {
- tokenize 32 $strip($1-,burci)
- if ($1 == !akore) {
- if ($2 == $null) { .msg $chan [ $+ $nick $+ ]: Error, Not enough parameters, La forma Correcta de usarlo es !akore <akore> | return }
- if ($2 !isnum) { .msg $chan [ $+ $nick $+ ]: Error, Incorrect parameters, try again and use only numbers! | return }
- sockget http://meteorologia.gov.py/interioradatos.php?depto= $+ $2 $nick $chan
- }
- }
- alias sockget {
- if (!$1-) { echo -ag ERROR: Enter the URL Page correctly! | return }
- var %s = sockget_ $+ $rand(1,100000)
- if ($sock(%s)) { sockclose %s }
- var %site = $1-
- var %get_host = $chr(47) $+ $gettok(%site,3-,47)
- var %host = $gettok(%site,2,47)
- if ($right(%site,1) == $chr(47)) && ($right(%get_host,1) !== $chr(47)) { var %get_host = %get_host $+ $chr(47) }
- if (*https* iswm %site) { sockopen -e %s %host 443 }
- else { sockopen %s %host 80 }
- sockmark %s %get_host $2 $3
- }
- ON *:SOCKOPEN:sockget_*: {
- if ($sockerr) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- .msg %c [ $+ %n $+ ]: Error, There was an connection problem to the website. - (Error Code: $+ $sock($sockname).wserr $+ ) - (Error Message: $+ $sock($sockname).wsmsg $+ )
- sockclose $sockname
- return
- }
- sockwrite -nt $sockname GET $gettok($sock($sockname).mark,1,32) HTTP/1.0
- sockwrite -n $sockname Host: $sock($sockname).addr
- sockwrite -n $sockname User-Agent: */*
- sockwrite -n $sockname Connection: Close
- sockwrite -nt $sockname $crlf
- }
- ON *:SOCKREAD:sockget_*: {
- if ($sockerr) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- .msg %c [ $+ %n $+ ]: Error, There was an connection reading problem to the website. - (Error Code: $+ $sock($sockname).wserr $+ ) - (Error Message: $+ $sock($sockname).wsmsg $+ )
- sockclose $sockname
- return
- }
- var %read
- sockread %read
- if ($sockbr) {
- ; echo -ag DATA: %read
- if (*<span class="Estilo24"><span class="Estilo31">* iswm %read) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- .msg %c 1° $httpstrip(%read)
- }
- if (*<div align="right" class="Estilo10">* iswm %read) && (*</div></td>* iswm %read) && (!%read2_ [ $+ [ $sockname ] ]) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- set -e %read2_ [ $+ [ $sockname ] ] 1
- .msg %c 2° $httpstrip(%read)
- }
- if (*<td height="29" colspan="2"><div align="center"><span class="Estilo5">* iswm %read) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- .msg %c 3° $httpstrip(%read)
- }
- if (*<div align="center" class="Estilo24">* iswm %read) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- var %text = $httpstrip(%read)
- var %text = $replace(%text,ó,ó)
- .msg %c 4° %text
- }
- if (*<td width="79" class="Estilo5 Estilo2 Estilo3">* iswm %read) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- .msg %c 5° $httpstrip(%read)
- }
- if (*<td width="85" class="Estilo5 Estilo2 Estilo3">* iswm %read) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- .msg %c 6° $httpstrip(%read)
- }
- if (*<td width="87" class="Estilo5 Estilo2 Estilo3">* iswm %read) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- .msg %c 7° $httpstrip(%read)
- }
- if (*<td><div align="center" class="Estilo4"><span class="Estilo51">* iswm %read) && (!%read8_ [ $+ [ $sockname ] ]) {
- var %n = $gettok($sock($sockname).mark,2,32)
- var %c = $gettok($sock($sockname).mark,3,32)
- if ($me !ison %c) { return }
- if (%n !ison %c) { return }
- set -e %read8_ [ $+ [ $sockname ] ] 1
- .msg %c 8° $httpstrip(%read)
- }
- }
- }
- ON *:SOCKCLOSE:sockget_*: {
- unset %read2_ [ $+ [ $sockname ] ] %read8_ [ $+ [ $sockname ] ]
- ; echo -ag CLOSED: $sock($sockname).addr SOCKET CONNNECTION!
- }
- alias httpstrip {
- var %xx = $replace($1-,&,$chr(38),$chr(124),-,$chr(125),-,},-,|,-,",$chr(34),&,&,<,<,>,>, ,$chr(32),&#039;,$chr(39),$chr(13),$chr(32))
- var %x = $remove(%xx,<![CDATA[,]]>,$chr(2),$chr(4),$chr(9),$chr(31),$chr(22),$chr(29),$chr(10),$chr(13))
- var %i = $regsub(%x,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x)
- return %x
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement