Page 1 of 1

BBC RSS Feeds with media:thumbnail

Posted: Wed Jan 16, 2008 4:09 am
by larrytech
~pickle | changed your [ code ] tags to [ xml ]

Hi,

I've been trawling the net for suggestions on how to deal with the media:thumbnail tag in BBC RSS feeds, but haven't had any luck so far. I'd like to incorporate them into the feed I'm working on.

The feed provided is:

Code: Select all

<item><title>Hain donations &apos;an incompetence&apos;</title><description>Peter Hain was guilty of "an incompetence" over donations that he has admitted to, the prime minister says.</description><link>http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/7190966.stm</link><guid isPermaLink="false">http://news.bbc.co.uk/1/hi/uk_politics/7190966.stm</guid><pubDate>Wed, 16 Jan 2008 08:04:51 GMT</pubDate><category>Politics</category><media:thumbnail width="66" height="49" url="http://newsimg.bbc.co.uk/media/images/44358000/jpg/_44358884_hain_66pic.jpg"/></item>
I can extract everything I need from that other than the URL http://newsimg.bbc.co.uk/media/images/4 ... _66pic.jpg I would need to show the image.

Any pointers in the right direction would be most appreciated!

Lawrence

~pickle | changed your [ code ] tags to [ xml ]

Re: BBC RSS Feeds with media:thumbnail

Posted: Wed Jan 16, 2008 6:22 am
by Kieran Huggins
so what are you trying to parse this with exactly? simpleXML? DOM? Let's see some code - I have a feeling you're having issues with "xml namespaces".

Re: BBC RSS Feeds with media:thumbnail

Posted: Wed Jan 16, 2008 7:09 am
by larrytech
I'm using magpierss http://magpierss.sourceforge.net/

But, if there's something else that will do it I am happy to try anything else.

Re: BBC RSS Feeds with media:thumbnail

Posted: Wed Jan 16, 2008 7:31 am
by Kieran Huggins
try simpleXML - it's in PHP5 core, if I'm not mistaken.

Re: BBC RSS Feeds with media:thumbnail

Posted: Wed Jan 16, 2008 10:51 am
by pickle
I've found SimplePie to be easier & more robust that magpieRSS.

Re: BBC RSS Feeds with media:thumbnail

Posted: Wed Jan 16, 2008 3:57 pm
by larrytech
Great, I've got it working with SimplePie. Really easy to use, and had it going within 5 minutes!

Thanks for the help :D