Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On *:CONNECT:{
- joinall
- timernt 0 05 nt
- }
- on *:sockopen:nt:{
- var %o sockwrite -tn $sockname
- %o GET /rss/temas_tiempo.xml HTTP/1.0
- %o Host: www.rtve.es
- ;%o User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko)
- %o Connection: Keep-Alive
- %o $crlf
- }
- on *:sockread:nt:{
- sockread -f %nt
- if <item> isin %nt {
- set %item si
- }
- if <title> isin %nt && %item == si {
- set %titulo $xmltag(%nt,title)
- set %title si
- halt
- }
- if <description> isin %nt && %title == si {
- set %description $sinhtml($xmltag($remove($unicode($xmltag(%nt,description)),<em>),li))
- if %ult != %titulo {
- .amsg 2T1iempo 4[2R1tve4] 1 $utf8(%titulo) $+ $utf8($iif(%description, |2 %description))
- set %ult %titulo
- }
- if %ult == %titulo {
- unset %item
- unset %title
- unset %description
- unset %titulo
- unset %nnt
- sockclose $sockname
- halt
- }
- unset %item
- unset %title
- unset %description
- unset %titulo
- unset %nnt
- sockclose $sockname
- halt
- }
- }
- on *:sockclose:nt:{
- unset %item %title %titulo %descripcion %titulo %nnt
- unset %nnt
- }
- alias nospam {
- set -u0 %x $nospam2($1)
- return $remove(%x,http://,http,www.,.com,.org,.net,.es,.ve,<,&,#309,:,;p,>,;;a,;p>;a,width=130,</p><br clear="all"/>,item,title)
- }
- alias nospam2 {
- return $1
- var %a 1
- while %a <= $numtok($1,32) {
- set -u0 %o %o $gettok($1,%a,32)
- if href= !isin $gettok($1,%a,32) http://*.* !iswm $gettok($1,%a,32) && $count($gettok($1,%a,32),/) < 1 if < !isin %o && align= !isin %o && heigh !isin %o && border="0" !isin %o && width= !isin %o && :p& !isin %o {
- set -u0 %ns %ns $gettok($1,%a,32)
- }
- inc %a
- }
- return %ns
- }
- alias xmltag { var %a = $pos($1,< $+ $2) , %b = $pos($1,</ $+ $2 $+ >) , %c = $pos($1,< $+ $2 $+ />) | if (%c) { return } | else { return $gettok($mid($1,%a,$calc(%b - %a)),2,62) } }
- alias nt {
- if $sock(nt) { sockclose nt }
- sockopen nt www.rtve.es 80
- }
- alias utf8 { return $replace($remove($1-,Â),á,á,ó,ó,ú,ú,Ã,í,é,é,ñ,ñ,Ó,Ó,ç,ç,Ã,Á,ü,ü,Ú,Ú,á,á,é,é,í,í,ó,ó,ú,ú,",",ñ,ñ,ª,ª,ç,ç,“,«,”,»,¡,¡,ñ,ñ,º,º,ü,ü,ú,ú,á,á) }
- alias unicode { return $replace($1,<,<,>,>,&,&,",",á,á,à,à,é,é,è,è,í,í,ì,ì,ó,ó,ò,ò,ú,ú,ù,ù,ä,ä,â,â,ë,ë,ê,ê,ï,ï,î,î,ö,ö,ô,ô,ü,ü,û,û,å,å,ã,ã,ç,ç,ñ,ñ,Ý,Ý,õ,õ,ý,ý,Ø,Ø,ÿ,ÿ,ø,ø,Þ,Þ,Ð,Ð,þ,þ,ð,ð,Æ,Æ,ß,ß,æ,æ,¼,¼, ,$chr(32),½,½,¡,¡,¾,¾,£,£,©,©,¥,¥,®,®,§,§,ª,ª,¤,¤,²,²,¦,¦,¯,¯,¬,¬,«,«,´,´,¨,¨,»,»,¸,¸,¿,¿) }
- alias sinhtml {
- var %a = $+ $1- $+
- if (< !isin $gettok(%a,1,62)) { if (> isin %a) %a = $+ $gettok(%a,2-,62) }
- :L1 | if (*<*>* iswm %a) { %a = $gettok(%a,1,60) $+ $gettok(%a,2-,62) | goto L1 }
- return $replace($remove($gettok(%a,1,60),), ,$chr(32))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement