Jan
13th
How To Access Attributes With MagpieRSS
Posted by nstar612MagpieRSS is a very popular script that provides an XML-based (expat) RSS parser in PHP. However, it doesn’t support attribute access by default. The good news is that the developers at MagpieRSS have been working on a patch release to support uniform access to attributes. In fact MagpieRSS 0.8 was released briefly as a DEV build. However, I am unable to find any working link to download the build.
MagpieRSS works well for existing RSS feeds. However, when dealing with Podcast feeds, it’s unable to look up attribute values in the enclosure tag.
Thanks to Jude Venn and Mike Krus, they have provided a patch to access the attribute values. Here is how:
- Download the patched version of rss_parse.inc.
- Replace the current rss_parse.inc with the downloaded patch. (the file is located in magpierss directory)
- Access attributes in your script as follows