Tech Note: Code Frenzy Continued
As I mentioned yesterday, I recently discovered that the LGF server was running PHP 5, not PHP 4 as I thought, and I’ve been like a geek in a gadget store ever since.
For years, the RSS news and blog feeds in our left sidebar were driven by a PHP 4 class called Magpie RSS, but now I’ve rewritten the LGF code to use PHP 5’s native SimpleXML functions.
The RSS format was pretty straightforward, but ATOM feeds required a little more geekage, because to do it right you have to properly handle an XML feature called “namespacing” while parsing the feed. The PHP SimpleXML documentation is rather … ahem … sparse on exactly how to do this, but this article at IBM’s developerWorks was very helpful: SimpleXML processing with PHP. And this comment at the PHP website showed me how to auto-detect whether an XML file is RSS or ATOM.
And now, we return to our regularly scheduled open thread.