homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

RSS displaying attributes
Correct way to get RSS feed attributes.

Msg#: 4444810 posted 8:54 pm on Apr 24, 2012 (gmt 0)

I am attempting to display results from an RSS feed using PHP.
I have successfully used magpie [magpierss.sourceforge.net...]
and rss_php [rssphp.net...]

However, both parsers I am having issues getting the attrbute values specifically media:thumbnail

<media:content url="http://cache.wdcdn.net/cdn/asset/view/client/sfi/ package/library/id/692313/format/o/h/5c5b86ff5dc804b2d314b3a9718bdef0/ JelloAdultContentDirsCut.m4v?7a6013aef28682d61703dff120d21b12266b54a2 a637283d7d4f0a0b41a1f35116ad845809e136636fd6663e34fb341ed348bcd006.m4v" fileSize="5936750" type="video/mp4" duration="32" height="360" width="640"/>

<media:thumbnail url="http://cache.wdcdn.net/cdn/asset/view/client/sfi/ package/library/id/692313/format/t/size/lg/h/ c374cb3c669fdb346ad82adb16b41b4a/library_692313_lg.jpg? 7a6013aef28682d61703dff120d21b12266b54a2a637283d7d4f0a0b41 a1f35116ad845809e136636fd6663e34fb341ed348bcd006.jpg" height="360" width="634"/>

<media:thumbnail url="http://cache.wdcdn.net/cdn/asset/view/client/sfi/ package/library/id/692313/format/t/size/sm/h/ c374cb3c669fdb346ad82adb16b41b4a/library_692313_sm.jpg? 7a6013aef28682d61703dff120d21b12266b54a2a637283d7d4f0a0b41a1f35116ad8 45809e136636fd6663e34fb341ed348bcd006.jpg" height="102" width="180"/>

<media:credit role="client" scheme="urn:feeds-wiredrive-com:credits"><![CDATA[Jell-O]]></media:credit>

<media:credit role="director" scheme="urn:feeds-wiredrive-com:credits"><![CDATA[Jerry Simpson]]></media:credit>

<media:credit role="agency" scheme="urn:feeds-wiredrive-com:credits"><![CDATA[CPB]]></media:credit>

<media:keywords><![CDATA[Chocolate, dessert, fruit, Jell-O, pudding]]></media:keywords></item>

any tips or help? I am stumped.

[edited by: eelixduppy at 1:18 pm (utc) on Apr 25, 2012]
[edit reason] fixed side scroll by adding spaces to URIs [/edit]



WebmasterWorld Senior Member 5+ Year Member

Msg#: 4444810 posted 9:03 am on Apr 25, 2012 (gmt 0)

If you change the tags from self-close to explicit does it work? Just in case the xsi:nil is not set.


Msg#: 4444810 posted 10:22 am on Apr 25, 2012 (gmt 0)

Unfortunately, I cannot change the feed in any way.


WebmasterWorld Senior Member 5+ Year Member

Msg#: 4444810 posted 12:40 pm on Apr 25, 2012 (gmt 0)

See if the parsers you use, have an option to enable self-closed tags and try it.


Msg#: 4444810 posted 7:51 pm on Apr 26, 2012 (gmt 0)

My solution was to use simplepie parser.

they have build in class for exactly this. get_thumbnail() and many others. Very good software and free.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved