|
Joined: Nov 2014
Posts: 27
Ameglian cow
|
OP
Ameglian cow
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? <td width="80" height="14%" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31">text</span></div></td> And this <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 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
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
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
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
Thanks But, As I do that? My code is 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
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
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
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
And if I want to read more lines as I do ...? First line <td width="80" height="14%" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31">text1</span></div></td> Second line <td width="59" height="86"><span class="Estilo7">text2</span></td> third line <td height="29" colspan="2"><div align="center"><span class="Estilo5">text3</span></div></td> fourth line <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
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
Each and every one of those lines you sent me, just use them as strings. 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
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2014
Posts: 27 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Dirección de Meteorología e Hidrología - Paraguay</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
</style>
<style type="text/css">
</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">°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 <strong>14:04</strong> h del <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ó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ón Térmica:</span></td>
<td ><div align="right" class="Estilo10">20.4</div></td>
<td><span class="Estilo10"> °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ó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ó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"> </td>
<td width="85" class="Estilo5 Estilo2 Estilo3">Miercoles 26</td>
<td width="59"> </td>
<td width="87" class="Estilo5 Estilo2 Estilo3">Jueves 27</td>
<td width="31"> </td>
</tr>
<tr>
<td><div align="center" class="Estilo4"><img src="adm/imgtpo/lluviaytsra.gif" width="60" height="60"></div></td>
<td> </td>
<td><div align="center" class="Estilo4"><img src="adm/imgtpo/chaparronyocnltsra.gif" width="60" height="60"></div></td>
<td> </td>
<td><div align="center" class="Estilo4"><img src="adm/imgtpo/parcialnublado.gif" width="60" height="60"></div></td>
<td> </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> </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> </td>
<td><div align="center" class="Estilo4"><span class="Estilo51">Cálido a caluroso, cielo parcialmente nublado, vientos del sureste. </span></div></td>
<td> </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> </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"> </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> </td>
</td> </tr>
</table>
<br>
</td></tr>
</table>
</body>
i need get this <td width="80" height="14%" bgcolor="#D7EBFF"><div align="center"><span class="Estilo24"><span class="Estilo31">Datos Actuales en Asunción</span></div></td> <td width="59" height="86"><span class="Estilo7">20.4</span></td> <div align="center" class="Estilo24">Pronóstico extendido para Asunción </div> <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"> </td>
<td width="85" class="Estilo5 Estilo2 Estilo3">Miercoles 26</td>
<td width="59"> </td>
<td width="87" class="Estilo5 Estilo2 Estilo3">Jueves 27</td>
<td width="31"> </td>
</tr>
<tr>
<td><div align="center" class="Estilo4"><img src="adm/imgtpo/lluviaytsra.gif" width="60" height="60"></div></td>
<td> </td>
<td><div align="center" class="Estilo4"><img src="adm/imgtpo/chaparronyocnltsra.gif" width="60" height="60"></div></td>
<td> </td>
<td><div align="center" class="Estilo4"><img src="adm/imgtpo/parcialnublado.gif" width="60" height="60"></div></td>
<td> </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> </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> </td>
<td><div align="center" class="Estilo4"><span class="Estilo51">Cálido a caluroso, cielo parcialmente nublado, vientos del sureste. </span></div></td>
<td> </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> </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"> </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> </td>
</tr>
</tbody></table>
<br>
</div>
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
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) 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
|
|
|
|
|