mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2014
Posts: 27
N
nexux Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Nov 2014
Posts: 27
Good and greetings

I was reading a web and works well, now, my problem is how to remove the html codes that have ..


How to remove this?
Html:
  <td width="80" height="14%" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31">text</span></div></td>


And this

Html:
<td width="59" height="86"><span class="Estilo7">text2</span></td>


And only make it so:

Text Text2

My code in my remote is to remove is , but no working
Code:
 if (  <td width=59 height=86><span class="Estilo7">isin %read) && (</td></span>isin%read) {
      .msg $gettok($sock($sockname).mark,3,32) [ $+ $gettok($sock($sockname).mark,2,32) $+ ]: $iif($remove(%read,<p>,</p>,<h1>,</h1>,<tr>,</tr>,<table>,</table>,</span>),$v1,No found)

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
alias noHTML return $regsubex($1, /<[^>]+(?:>|$)|^[^<>]+>/g, $null)

Edit: I just noticed that in your attempt to remove it yourself you're not using spaces between "isin" and "%read" which is required.

Last edited by Nillen; 25/11/14 03:09 PM.

Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Nov 2014
Posts: 27
N
nexux Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Nov 2014
Posts: 27
Thanks

But, As I do that?

My code is

Code:
if ($sockbr) { 
    ; echo -ag DATA: $left(%read,4096)
    if (<td width="80" height="42" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31">isin %read) && (</td></div></span>isin%read) {
      .msg $gettok($sock($sockname).mark,3,32) [ $+ $gettok($sock($sockname).mark,2,32) $+ ]: $iif($remove(%read,<p>,</p>,<h1>,</h1>,<tr>,</tr>,<table>,</table>,<span>,</span>,class,width,59,height,86,width="59"),$v1,Not any results founded)
    }


How to insert this striphtml ?


Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
var %chan $gettok($sock($sockname).mark,2,32)
if ($sockbr) { 
  ; echo -ag DATA: $left(%read,4096)
  if ((Estilo isin %read) && (</td></div></span> isin %read)) {
    .msg %chan [ $+ %chan $+ ]: $iif($nohtml(%read),$v1,Not any results founded)
  }


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Nov 2014
Posts: 27
N
nexux Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Nov 2014
Posts: 27
And if I want to read more lines as I do ...?

First line

Html:
<td width="80" height="14%" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31">text1</span></div></td>


Second line

Html:
<td width="59" height="86"><span class="Estilo7">text2</span></td>


third line

Html:
<td height="29" colspan="2"><div align="center"><span class="Estilo5">text3</span></div></td>



fourth line

Html:
<td><div align="center" class="Estilo4"><span class="Estilo51">text4</span></div></td>



And I need to appear like this:

text1 - text2 - text3 - text4

Note that each party is in other lines, not in the same


Is that possible?

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Each and every one of those lines you sent me, just use them as strings.

Code:
var %string <td width="80" height="14%" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31">text1</span></div></td>
var %nohtml $nohtml(%string)


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Nov 2014
Posts: 27
N
nexux Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Nov 2014
Posts: 27
Html:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Direcci&oacute;n de Meteorolog&iacute;a e Hidrolog&iacute;a - Paraguay</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {
	font-size: 16px;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	color: #FFFFFF;
}
.Estilo2 {font-family: Arial, Helvetica, sans-serif}
.Estilo3 {font-size: 12px}
.Estilo4 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
.Estilo5 {font-weight: bold}
.Estilo7 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
}
.Estilo8 {color: #000000}
.Estilo51 {
	font-size: 10px;

	font-family: Arial, Helvetica, sans-serif;
}
-->
</style>

<style type="text/css">

<!--

.Estilo5 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; }
.Estilo7 {font-size: 42px; font-family: Arial, Helvetica, sans-serif; }
.Estilo8 {font-size: 12px}
.Estilo10 {font-size: 12px;	font-family: Arial, Helvetica, sans-serif; text-align: right; }
.Estilo13 {color: #666666}
.Estilo14 {font-size: 14px; font-weight: bold; font-family: Arial, Helvetica, sans-serif; color: #0C61A9; }
.Estilo15 {font-size: 9px}
.Estilo18 {color: #D7EBFF}
.Estilo23 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #333333; }
.Estilo24 {font-size: 24px; font-weight: bold; font-family: Arial, Helvetica, sans-serif; color: #0C61A9; }
.Estilo25 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.Estilo27 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; color: #333333; }
.Estilo28 {font-family: Arial, Helvetica, sans-serif}
.Estilo29 {color: #333333; font-size: 12px; }

.style1 {
				text-align: center;
}

-->

</style>

</head>
<body>
<table width="563" border="0" align="center">
  <tr>
    <td width="557"><div align="center"><img src="logo_mapa_secciones.JPG" width="563" height="100"><br>
      <br>
 <table width="458" height="0%" border="0" align="center" cellpadding="2" cellspacing="0">
          <td width="80" height="14%" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31">Datos Actuales en Asunción</span></div></td>
        <tr>
          <td width="29" height="100%" align="center" valign="top"><table width="229" border="0" cellspacing="2" cellpadding="2">
            <tr>	
              <td height="117" colspan="3"><table width="229" height="115" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
				    
                  <td width="90" rowspan="2"><img src="adm/imgtpo/nublado.gif" alt="nublado.gif"  width="80" height="80"></td>
                  <td width="59" height="86"><span class="Estilo7">20.4</span></td>
                  <td width="55"><span class="Estilo7">&deg;C</span></td>
                </tr>
                <tr>
                  <td height="29" colspan="2"><div align="center"><span class="Estilo5">TORMENTA CON LLUVIA </span></div></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="3" style="width: 358px; height: 21px;" class="style1"><span class="Estilo10">Actualizado a las&nbsp;<strong>14:04</strong> h&nbsp; del &nbsp;<strong>25/11/2014</strong></span></td>
            </tr>
           <table width="458" height="0%" border="0" align="left" cellpadding="2" cellspacing="0">
            <tr>
              <td ><span class="Estilo10">Presi&oacute;n:</span></td>
              <td ><div align="rigth" class="Estilo10">997.018</div></td>
              <td ><span class="Estilo10">hPa</span></td>
            </tr>
            <tr>
              <td ><span class="Estilo10">Sensaci&oacute;n Térmica:</span></td>
               <td ><div align="right" class="Estilo10">20.4</div></td>
              <td><span class="Estilo10"> &deg;C</span></td>
            </tr>        
			<tr>
              <td><span class="Estilo10">Humedad:</span></td>
              <td><div align="right" class="Estilo10">90</div></td>
              <td><span class="Estilo10">%</span></td>
            </tr>
            <tr>
              <td><span class="Estilo10">Visibilidad:	</span></td>
              <td><div align="right" class="Estilo10">20</div></td>
			  <td><span class="Estilo10"></span></td>
            </tr>
            <tr>
				<td><span class="Estilo10">Direcci&oacute;n del viento: </span></td>
				<td><div align="right" class="Estilo10">Sureste</div></td>
                <td><span class="Estilo10"></span></td>
            </tr>
            <tr>
              <td><span class="Estilo10">Intensidad del viento: 	</span></td>
              <td><div align="right" class="Estilo10">27</div></td>
			  
              <td><span class="Estilo10">Km/h</span></td>
            </tr>
            <tr>
              <td><span class="Estilo10">Salida del sol: 	</span></td>
              <td><div align="right" class="Estilo10">05:56</div></td>
              <td><span class="Estilo10">h</span></td>
            </tr>
            <tr>
              <td><span class="Estilo10">Puesta del sol: 	</span></td>
              <td><div align="right" class="Estilo10">19:20</div></td>
              <td><span class="Estilo10">h</span></td>
            </tr>
          </table>
		  
          </td></table>
		  
		  </tr>
      </table>    
	  
        <div align="center">  </div>       
    </td></tr>
<br> <br>

  <tr bgcolor="#0084C4">
    <td height="55" bgcolor="#C6ECFF"><div align="center" class="Estilo1">
      <div align="center" class="Estilo24">Pron&oacute;stico extendido para Asunción </div>
      <div align="center" class="Estilo3">Actualizado:  2014-11-25 11:34:58 </div>
    </div></td>
  </tr>
  <tr>
    <td height="334" valign="top"><div align="center" class="Estilo7">
            <table width="440" border="0" align="center">
          <tr>
            <td width="79" class="Estilo5 Estilo2 Estilo3">Martes 25</td>
            <td width="63">&nbsp;</td>
            <td width="85" class="Estilo5 Estilo2 Estilo3">Miercoles 26</td>
            <td width="59">&nbsp;</td>
            <td width="87" class="Estilo5 Estilo2 Estilo3">Jueves 27</td>
            <td width="31">&nbsp;</td>
          </tr>
          <tr>
            <td><div align="center" class="Estilo4"><img src="adm/imgtpo/lluviaytsra.gif" width="60" height="60"></div></td>
            <td>&nbsp;</td>
            <td><div align="center" class="Estilo4"><img src="adm/imgtpo/chaparronyocnltsra.gif" width="60" height="60"></div></td>
            <td>&nbsp;</td>
            <td><div align="center" class="Estilo4"><img src="adm/imgtpo/parcialnublado.gif" width="60" height="60"></div></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><div align="center" class="Estilo4"><span class="Estilo51">Cálido, cielo mayormente nublado, vientos variables, precipitaciones con tormentas eléctricas.                                                                                                          </span></div></td>
            <td>&nbsp;</td>
            <td><div align="center" class="Estilo4"><span class="Estilo51">Cálido a caluroso, cielo mayormente nublado, vientos variables, luego rotando al sur, precipitaciones dispersas con ocasionales tormentas eléctricas.                                                   </span></div></td>
            <td>&nbsp;</td>
            <td><div align="center" class="Estilo4"><span class="Estilo51">Cálido a caluroso, cielo parcialmente nublado, vientos del sureste.                                                                                                                                     </span></div></td>
            <td>&nbsp;</td>
          </tr>
          <tr>           
                        <td><p align="center" class="Estilo10 Estilo13 Estilo15 Estilo2 Estilo3"><strong><br>
              
            </strong><span class="Estilo5">M&aacute;xima: <strong>24                                           &ordm;C</strong></span></p></td>
            <td>&nbsp;</td>
            <td><p align="center" class="Estilo5">M&iacute;nima: <strong>20                                           &ordm;C<br>
            </strong><span class="Estilo5">M&aacute;xima: <strong>33                                           &ordm;C</strong></span></p></td>
            <td><p align="center" class="Estilo5">&nbsp;</p></td>
            <td><p align="center" class="Estilo5">M&iacute;nima: <strong>22                                           &ordm;C<br>
            </strong><span class="Estilo5">M&aacute;xima: <strong>34                                           &ordm;C</strong></span></p></td>
            <td>&nbsp;</td>
         </td>  </tr>   
           </table>
    <br>
 </td></tr>
</table>

</body>



i need get this


Html:
<td width="80" height="14%" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31">Datos Actuales en Asunción</span></div></td>

Html:
<td width="59" height="86"><span class="Estilo7">20.4</span></td>

Html:
      <div align="center" class="Estilo24">Pron&oacute;stico extendido para Asunción </div>

Html:
<div align="center" class="Estilo7">
            <table width="440" border="0" align="center">
          <tbody><tr>
            <td width="79" class="Estilo5 Estilo2 Estilo3">Martes 25</td>
            <td width="63">&nbsp;</td>
            <td width="85" class="Estilo5 Estilo2 Estilo3">Miercoles 26</td>
            <td width="59">&nbsp;</td>
            <td width="87" class="Estilo5 Estilo2 Estilo3">Jueves 27</td>
            <td width="31">&nbsp;</td>
          </tr>
          <tr>
            <td><div align="center" class="Estilo4"><img src="adm/imgtpo/lluviaytsra.gif" width="60" height="60"></div></td>
            <td>&nbsp;</td>
            <td><div align="center" class="Estilo4"><img src="adm/imgtpo/chaparronyocnltsra.gif" width="60" height="60"></div></td>
            <td>&nbsp;</td>
            <td><div align="center" class="Estilo4"><img src="adm/imgtpo/parcialnublado.gif" width="60" height="60"></div></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><div align="center" class="Estilo4"><span class="Estilo51">Cálido, cielo mayormente nublado, vientos variables, precipitaciones con tormentas eléctricas.                                                                                                          </span></div></td>
            <td>&nbsp;</td>
            <td><div align="center" class="Estilo4"><span class="Estilo51">Cálido a caluroso, cielo mayormente nublado, vientos variables, luego rotando al sur, precipitaciones dispersas con ocasionales tormentas eléctricas.                                                   </span></div></td>
            <td>&nbsp;</td>
            <td><div align="center" class="Estilo4"><span class="Estilo51">Cálido a caluroso, cielo parcialmente nublado, vientos del sureste.                                                                                                                                     </span></div></td>
            <td>&nbsp;</td>
          </tr>
          <tr>           
                        <td><p align="center" class="Estilo10 Estilo13 Estilo15 Estilo2 Estilo3"><strong><br>
              
            </strong><span class="Estilo5">Máxima: <strong>24                                           ºC</strong></span></p></td>
            <td>&nbsp;</td>
            <td><p align="center" class="Estilo5">Mínima: <strong>20                                           ºC<br>
            </strong><span class="Estilo5">Máxima: <strong>33                                           ºC</strong></span></p></td>
            <td><p align="center" class="Estilo5">&nbsp;</p></td>
            <td><p align="center" class="Estilo5">Mínima: <strong>22                                           ºC<br>
            </strong><span class="Estilo5">Máxima: <strong>34                                           ºC</strong></span></p></td>
            <td>&nbsp;</td>
           </tr>   
           </tbody></table>
    <br>
 


</div>


Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
If you know exactly the lines you're looking for you can just enter them and look for them? If the line matches, just return the value of $nohtml(%read)
Code:
on *:sockread:SOCKNAME: {
  var %read 
  sockread -f %read
  if (<td width="80" height="14%" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31"> isin %read) set %tok %tok $nohtml(%read)
  elseif (<td width="59" height="86"><span class="Estilo7"> isin %read) set %tok %tok $nohtml(%read)
  elseif (<div align="center" class="Estilo24"> isin %read) set %tok %tok $nohtml(%read)
}
on *:sockclose:SOCKNAME: { 
  if (%tok) msg $gettok($sock($sockname).mark,3,32) %tok
  unset %tok
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard