
June 23rd, 2000, 06:39 AM
|
 |
Contributing User
|
|
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
|
|
|
Here it is, I would appreciate any comments on how to cleanup/optimize the regular expressions as this is quite a slow way to do it.
<html><title></title>
<body bgcolor="#ffffff">
<table width=780 border=0>
<?php
$file = fopen("http://www.devshed.com/devshednews.rdf", "r"); //open file for reading
$rf = fread($file, 32000); // read 32K
$grab = eregi("<item>(.*)</item>", $rf, $printing);
$pieces = explode("<item>", $printing[0]);
$count=count($pieces);
for($x=1;$x<=$count-1;$x++){
ereg("<title>(.*)</title>",$pieces[$x],$title );
ereg("<link>(.*)</link>",$pieces[$x],$links );
ereg("<description>(.*)</description>",$pieces[$x],$desc );
?>
<tr><td><H1><?php echo $title[1];?></H1></td></tr>
<tr><td><h3><?php echo $desc[1];?>,</h3></td></tr>
<tr><td><a href="<?php echo $links[1];?>">Click here for the full story</a>(<?php echo $links[1];?> )</td></tr>
<?php
}
?>
</table>
</body>
</html>
Note:I have a proxy server that disalows ne grabbibg the rdf as above - You may need to ask your isp to cache a copy of the page for you.
Simon Wheeler
Simon Wheeler.
------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL
|