PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 23rd, 2000, 06:39 AM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Devshednews.rdf XML Parser

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap