BBC RSS Feeds with media:thumbnail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
larrytech
Forum Commoner
Posts: 35
Joined: Thu Jun 06, 2002 8:27 am

BBC RSS Feeds with media:thumbnail

Post 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 ]
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: BBC RSS Feeds with media:thumbnail

Post 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".
larrytech
Forum Commoner
Posts: 35
Joined: Thu Jun 06, 2002 8:27 am

Re: BBC RSS Feeds with media:thumbnail

Post 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.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: BBC RSS Feeds with media:thumbnail

Post by Kieran Huggins »

try simpleXML - it's in PHP5 core, if I'm not mistaken.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: BBC RSS Feeds with media:thumbnail

Post by pickle »

I've found SimplePie to be easier & more robust that magpieRSS.
larrytech
Forum Commoner
Posts: 35
Joined: Thu Jun 06, 2002 8:27 am

Re: BBC RSS Feeds with media:thumbnail

Post 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
Post Reply