Advertisement
Guest User

Untitled

a guest
May 26th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. On *:CONNECT:{
  2. joinall
  3. timernt 0 05 nt
  4. }
  5. on *:sockopen:nt:{
  6. var %o sockwrite -tn $sockname
  7. %o GET /rss/temas_tiempo.xml HTTP/1.0
  8. %o Host: www.rtve.es
  9. ;%o User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko)
  10. %o Connection: Keep-Alive
  11. %o $crlf
  12. }
  13. on *:sockread:nt:{
  14. sockread -f %nt
  15. if <item> isin %nt {
  16.  
  17. set %item si
  18. }
  19. if <title> isin %nt && %item == si {
  20. set %titulo $xmltag(%nt,title)
  21. set %title si
  22. halt
  23. }
  24.  
  25. if <description> isin %nt && %title == si {
  26. set %description $sinhtml($xmltag($remove($unicode($xmltag(%nt,description)),<em>),li))
  27. if %ult != %titulo {
  28. .amsg 2T1iempo  4[2R1tve4] 1 $utf8(%titulo) $+ $utf8($iif(%description, |2 %description)) 
  29. set %ult %titulo
  30. }
  31. if %ult == %titulo {
  32. unset %item
  33. unset %title
  34. unset %description
  35. unset %titulo
  36. unset %nnt
  37. sockclose $sockname
  38. halt
  39. }
  40. unset %item
  41. unset %title
  42. unset %description
  43. unset %titulo
  44. unset %nnt
  45. sockclose $sockname
  46. halt
  47. }
  48. }
  49.  
  50.  
  51. on *:sockclose:nt:{
  52. unset %item %title %titulo %descripcion %titulo %nnt
  53. unset %nnt
  54. }
  55. alias nospam {
  56. set -u0 %x $nospam2($1)
  57. return $remove(%x,http://,http,www.,.com,.org,.net,.es,.ve,&lt,&amp;,#309,:,;p,&gt,;;a,;p&gt;;a,width=130,&lt;/p&gt;&lt;br clear="all"/&gt;,item,title)
  58. }
  59. alias nospam2 {
  60. return $1
  61. var %a 1
  62. while %a <= $numtok($1,32) {
  63. set -u0 %o %o $gettok($1,%a,32)
  64. if href= !isin $gettok($1,%a,32) http://*.* !iswm $gettok($1,%a,32) && $count($gettok($1,%a,32),/) < 1 if &lt !isin %o && align= !isin %o && heigh !isin %o && border="0" !isin %o && width= !isin %o && :p& !isin %o {
  65. set -u0 %ns %ns $gettok($1,%a,32)
  66. }
  67. inc %a
  68. }
  69. return %ns
  70. }
  71. 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) } }
  72. alias nt {
  73. if $sock(nt) { sockclose nt }
  74. sockopen nt www.rtve.es 80
  75. }
  76. alias utf8 { return $replace($remove($1-,Â),á,á,ó,ó,ú,ú,í,í,é,é,ñ,ñ,Ó,Ó,ç,ç,Á,Á,ü,ü,Ú,Ú,&aacute;,á,&eacute;,é,&iacute;,í,&oacute;,ó,&uacute;,ú,&quot;,",&ntilde;,ñ,&ordf;,ª,&ccedil;,ç,&ldquo;,«,&rdquo;,»,&iexcl;,¡,ñ,ñ,&ordm;,º,&uuml;,ü,ú,ú,á,á) }
  77. alias unicode { return $replace($1,&lt;,<,&gt;,>,&amp;,&,&quot;,",&aacute;,á,&agrave;,à,&eacute;,é,&egrave;,è,&iacute;,í,&igrave;,ì,&oacute;,ó,&ograve;,ò,&uacute;,ú,&ugrave;,ù,&auml;,ä,&acirc;,â,&euml;,ë,&ecirc;,ê,&iuml;,ï,&icirc;,î,&ouml;,ö,&ocirc;,ô,&uuml;,ü,&ucirc;,û,&aring;,å,&atilde;,ã,&ccedil;,ç,&ntilde;,ñ,&Yacute;,Ý,&otilde;,õ,&yacute;,ý,&Oslash;,Ø,&yuml;,ÿ,&oslash;,ø,&THORN;,Þ,&ETH;,Ð,&thorn;,þ,&eth;,ð,&AElig;,Æ,&szlig;,ß,&aelig;,æ,&frac14;,¼,&nbsp;,$chr(32),&frac12;,½,&iexcl;,¡,&frac34;,¾,&pound;,£,&copy;,©,&yen;,¥,&reg;,®,&sect;,§,&ordf;,ª,&curren;,¤,&sup2;,²,&brvbar;,¦,&macr;,¯,&not;,¬,&laquo;,«,&acute;,´,&uml;,¨,&raquo;,»,&cedil;,¸,&iquest;,¿) }
  78. alias sinhtml {
  79. var %a =  $+ $1- $+ 
  80. if (< !isin $gettok(%a,1,62)) { if (> isin %a) %a =  $+ $gettok(%a,2-,62) }
  81. :L1 | if (*<*>* iswm %a) { %a = $gettok(%a,1,60) $+ $gettok(%a,2-,62) | goto L1 }
  82. return $replace($remove($gettok(%a,1,60),),&nbsp;,$chr(32))
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement