[thelist] PHP html Feed modifying/parsing

Tim Fountain tim at incutio.com
Wed Jul 9 07:53:41 CDT 2003


Wednesday, July 9, 2003, 8:55:38 AM, Razzak wrote:

> A friend of mine has a list on his site that I'd like to include on
> my site. He said it's fine and so I want to know how to do the
> following:

> 1) Have the server download the page every hour and store it locally on 
> my server.
> 2) Search it to find the text <a href= ... </a> AFTER a certain point 
> in the document <---startlist--> for example.
> 3) Save that information to a file that can be easily included on pages.

> I assume the first part would need some kind of cron job or something 
> different than php.  Not really sure how I'd implement that.

You can setup cron jobs to run PHP scripts easily enough, providing
you know how to setup cron jobs to start with.

> The important part is step 2.

> I'm not asking you to do this for me, but if you could give me a link 
> to a tutorial which i've had trouble finding via google or at least a 
> list of the functions I'll need in PHP.

substr() will allow you to remove all of the document up to and
including the comment.  If there will only ever be one link in the
rest of it, you may be able to do this stage with substr() as well.
However I would probably normally use preg_match (regular expressions,
which seem to scare many people ;)).

Stage three is easy.

Good luck.

-- 
Tim Fountain | Web developer | Incutio Limited | www.incutio.com
email: tim at incutio.com | Tel: +44 8708 700 333 | Fax: +44 7092 181 581



More information about the thelist mailing list