Click to See Complete Forum and Search --> : Retrieving news headlines from an external RSS fille
alisdairi
09-26-2003, 09:41 PM
I've made a little ticker for my site and now I want to make it access the BBC headlines from:
http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world/rss091.xml
Unfortunately, I don't know how to embed the text from this page into my site. How?
I appreciate any help I can get.
Khalid Ali
09-26-2003, 10:50 PM
rss files are XML files,you will need to read the XML file,parse the contents and display them.
The RSS files have a the following format
<item><!-- represents one item of data, below is the rest of the contents//-->
<title>Tite of hte item</title>
<description>Description of the conent</description>
<link>URL:</link>
</title>
The best option will be to use server side language to open the rss file and process it and then diplay it in a page....
alisdairi
09-26-2003, 11:33 PM
I was hoping I wouldn't have to. My php is limited, but I guess I will do it that way. I was jsut being lazy. Would this work to access the file before parsing?
$filename = "http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world/rss091.xml" ;
$fp = fopen ($filename , 'rb' );
$filevalue = fread ($fp , filesize ($filename ));
fclose ($fp );
echo $filevalue ;
??
Khalid Ali
09-26-2003, 11:39 PM
it should....I am not way too familiar with php ,but I know that it has some mecahnism to read XML files as well,I am sure you will be better off using that for RSS files.
XMLMania.com
09-27-2003, 04:07 AM
ROFL - You can't just open an XML file in PHP and expect it to be parsed...
Try: http://uk2.php.net/manual/en/ref.xml.php for PHP's XML functions.
And there are many RSS parsers at http://www.hotscripts.com
- Martin
Khalid Ali
09-27-2003, 08:14 AM
Originally posted by XMLMania.com
ROFL
- Martin
I beg your pardon, what did I miss that was so funny...