mIRC Home    About    Download    Register    News    Help

Print Thread
#82885 13/05/04 11:24 AM
Joined: May 2004
Posts: 17
S
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
Posts: 17
Im connected with a socket at a web page, the html code is:
Quote:

<html>

<head>
<title>Site Name</title>
<style>
<!--
body { font-family: Arial, Helvetica, sans-serif; color : gray; }
A { text-decoration : none; color : teal; }
A:Hover { text-decoration : underline; color : teal; }
-->
</style><script language="JavaScript1.2">function songinfo(songID)
{
songwin = window.open("songinfo.php?songID="+songID, "songinfowin", "location=no,status=no,menubar=no,scrollbars=yes,resizeable=yes,height=400,width=650");
}</script>
<script language='JavaScript1.2' src='http://www.audiorealm.com/player/player.js.html?srefID=1&subscription=no'></script>
<script language='JavaScript1.2'>function request(songID)
{
reqwin = window.open("req.php?songID="+songID, "_AR_request", "location=no,status=no,menubar=no,scrollbars=no,resizeable=yes,height=420,width=668");
}
</script>
</head>

<body>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="center"><a href="playing.php"><img border="0" src="images/logo.gif"></a><br>
<img border="0" src="images/spacer.gif" width="15" height="13"></td>
<td width="99%" valign="middle" align="left"><b><font size="5"> &nbsp; Site Name</font></b></td>
</tr>
<tr>
<td width="100%" colspan="2" bgcolor="#000080"><img border="0" src="images/spacer.gif" width="1" height="1"></td>
</tr>
</table>

<br>

<table border=0 cellspacing=5 cellpadding=5>
<tr>
<td align="center" valign="top" width="1%">
<table border="0" cellspacing="0" cellpadding="2" bgcolor="#EEEEEE">
<tr>
<td nowrap colspan="2" bgcolor="#C0C0C0" align="center"><b>Navigation</b></td>
</tr>
<tr>
<td nowrap align="center"><img border="0" src="images/speaker.gif"></td>
<td nowrap><a href="javascript:player(0,-1)">Click here</a> </td>
</tr>
<tr>
<td nowrap align="center"><img border="0" src="images/play.gif"></td>
<td nowrap><a href="playing.php">on-air</a></td>
</tr>
<tr>
<td nowrap align="center"><img border="0" src="images/tb-file-list.gif"></td>
<td nowrap><a href="playlist.php?limit=25">Playlist &amp; Request</a></td>
</tr>
<tr>
<td nowrap align="center"><img border="0" src="images/chat.gif"></td>
<td nowrap><a href="chat.php">Chat</a></td>
</tr>
<tr>
<td nowrap align="center"><img border="0" src="images/email.gif"></td>
<td nowrap><a href="mailto:poldoj2002@hotmail.com">Postme!</a></td>
</tr>
<tr>
<td nowrap align="center"><img border="0" src="images/tb-file-list.gif"></td>
<td nowrap><a href="forum/index.php">Forum</a></td>
</tr>
</table>
<br>
<br>
....
....


The code go further and further.
I want to retrieve a portion of that html code in a variable and display it in chan with this code.

Quote:

on *:sockread:MySocket:{
if ($sockerr > 0) return
else {
:nextread
sockread -f %scasttemp
if ($sockbr == 0) return
if (%scasttemp == $null) %scasttemp = empty
set %scasttemp $gettok(%scasttemp,25-,44)
msg $active %scasttemp
goto nextread
}
}

The problem is that the $gettok works only till a 9- ( "$gettok(%scasttemp,9-,44)"), if I put 25- then in chan is display nothing. I need a portion of code in the middle of the page I need so to put a higher value for my token.
Thanks to all.

#82886 13/05/04 11:12 PM
Joined: May 2004
Posts: 17
S
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
Posts: 17
sorry for this, I have tried this code:
Quote:

set %scasttemp $gettok(%scasttemp,1,60)
msg $active %scasttemp


And it retrieve a list of line with the code that I was looking for, something like this:

Quote:

<client> ******
<client> ******
<client> tr>
<client> font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#464646">
<client> MY LINE HERE
<client> /small>
<client> br>
<client> *****
<client> *****


Now the question, how to display only the line of my interest and not the rest of displayed lines before and after?
With the gettok can I detect a new line?
Thanks


Link Copied to Clipboard