new patterm:
Code:
<tr bgcolor="#ffc858">
<td><font size="+1"><a name=Catskills>Catskills:</a></font></td>
<td width="230" nowrap><img height=17 src="http://ultima.lightning.net/uo/img/grnball.gif" width=17
align=top> UP! for 6h 00m 05s</td>
<td width="170"><font size="-1"><a class=tbl href="http://ultima.lightning.net/uo/en/history/Catskills.html">details >></a></font></td>
</tr>
revised version:
PHP Code:
<?
$remote_site = join('', file("http://ultima.lightning.net/uo/index.html") );
preg_match_all(
"|<tr.*<a name=.*>(.*):</a>.*src=\"(.*)\".*</tr>|Usi",
$remote_site, $matches);
echo "<html>\n";
echo "<body>\n";
echo "<table border=0 cellpadding=0 cellspacing=0 align=center>\n";
for ($i=0; $i<count($matches[0]); $i++) {
$name = $matches[1][$i];
$image = $matches[2][$i];
echo " <tr>\n";
echo " <td>";
if (strstr($image, 'grnball.gif')) {
echo "<img src='http://nettiq.com/images/image1.gif'>";
}
else {
echo "<img src='http://nettiq.com/images/image2.gif'>";
}
echo "</td>\n";
echo " <td>\n";
echo "\t<font face='verdana,arial,helvetica' size='1'> ";
echo $name;
echo "</font><BR>\n";
echo " </td>\n";
echo " </tr>\n";
} //END for
echo "</table>\n";
echo "<br>\n";
echo "<center>\n";
echo "<font face='verdana,arial,helvetica' size='1'>\n";
echo "<a href='$PHP_SELF'>Refresh</a>\n";
echo "</font>\n";
echo "</center>\n";
echo "</body>\n";
echo "</html>\n";
?>
It's always a pain when the remote site changes their pattern. 8[