Re: XML news from moreover

From: Date: Tue, 26 Sep 2000 03:02:14 +0000
Subject: Re: XML news from moreover
Groups: php.general 
Request: Send a blank email to php-general+get-17480@lists.php.net to get a copy of this message
Addressed to: lbergman@abi.tconline.net php-general@lists.php.net ** Reply to note from Lewis Bergman <lbergman@abi.tconline.net> Mon, 25 Sep 2000 13:33:46 -0500 > > Goal: To periodically download all moreover news and insert them into a db > so users can later pick from free form searches or categories and include > those in a "mypage" kind of deal. Moreover doesn't care as long as I give > credit where credit is due, keep the links live, and don't include actual > article text. > > Facts: I have researched moreover's XML format which is very logical and > predictable and would seem easy to parse and insert into a db. > > Other Facts: No idea where to go. I haven't done any XML, do I need to use > the xml parser for this? Would it be faster? It seems like I could just > search with get ( They have a distinct URL for each category and format ) > and do an insert in to the db for the different fields. Sockets maybe? > Really clueless on where to start here. > > I have only used php to generate pages. Never to go get some, process > them, and store them. Take a look at the php manual: http://www.php.net/manual/ref.xml.php Everything you need to parse an incoming xml file. Just replace the name of the incoming file in the examples to something like: $file = "http://www.whatever.com/headlines.xml"; You will get callbacks at the beginning and ending of each tag as it goes by. I was amazed how easy it was. I went from an xml file and wondering what to do with it, to a working web page that downloads and displays headlines in about two hours. The hardest part is figuring out what to do when as the parser does its job. That depends on the format of the incoming file, so I can't help much without seeing that. Rick Widmer Internet Marketing Specialists www.developersdesk.com

« previous php.general (#17480) next »