Jan
13th

How To Access Attributes With MagpieRSS

Posted by nstar612

MagpieRSS 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:

  1. Download the patched version of rss_parse.inc.
  2. Replace the current rss_parse.inc with the downloaded patch. (the file is located in magpierss directory)
  3. Access attributes in your script as follows

  • Share/Bookmark
Files under Blogging, PHP


2 Responses to “How To Access Attributes With MagpieRSS”

  1. By Adonis Nafeh on Jan 13, 2009 | Reply

    Good articles and great work on the site, keep up the good work

  2. By kaliseo on Jan 16, 2010 | Reply

    Doex not work with other attributes… only with enclosure

Post a Comment