Advertisement
SoyTupa

Untitled

Apr 25th, 2024
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.12 KB | None | 0 0
  1. on *:SOCKREAD:nacional:{
  2.   if ($sockerr > 0) {
  3.     echo -s $hget(ns,domen) : $error
  4.     | halt
  5.   }
  6.  
  7.   :readmore
  8.   .sockread %temp_ns
  9.   if ($sockbr == 0) {
  10.     ; Final de la lectura, comprobamos si hemos encontrado contenido
  11.     if (%temp_ns) {
  12.       ; Filtramos el contenido para encontrar las etiquetas deseadas
  13.       var %ns_find = id="nacionalU"
  14.       if (%temp_ns && $regex(%temp_ns, /%ns_find/)) {
  15.         var %content = $strip($regml(%temp_ns,/<li id="nacionalU">(.*)<\/li>/s))
  16.         if (%content) {
  17.           .write -c $hget(ns,file) %content
  18.         }
  19.       }
  20.     }
  21.     return
  22.   }
  23.  
  24.   ; Buscamos la línea "X-Request-ID"
  25.   if ($hget(ns,foundXRequestID)) {
  26.     ; Escribimos al archivo si ya encontramos la línea
  27.     .write -i $hget(ns,file) %temp_ns
  28.   }
  29.   else {
  30.     ; Si aún no hemos encontrado la línea, comprobamos si esta línea contiene "X-Request-ID"
  31.     if (*X-Request-ID* isin %temp_ns) {
  32.       ; Marcamos que hemos encontrado la línea "X-Request-ID"
  33.       .hadd ns foundXRequestID $true
  34.       ; Escribimos al archivo
  35.       .write -i $hget(ns,file) %temp_ns
  36.     }
  37.   }
  38.  
  39.   goto readmore
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement