Tuesday, June 29, 2004

PHP RSS Parser and Conditional Tags

Well, as previously posted I downloaded Magpie, unzipped the files and then uploaded them to the BifSniff site.
At first I wasn't sure what to do because the Magpie site assumes more knowledge than I have of PHP and so the Install instructions were vague to say the least.
However I finally figured out which files to upload where, and got it working.
In order to use Magpie you then have to write a php script to display RSS feeds. Or you can modify the simple sample scripts that come with it which is what I did. They are very simple to get to grips with.

Magpie includes a debugging script which you can run to see if everything is working ok - the only problem I had was that the debugging script said that it couldn't create the cache - I got onto my hosting providers support team and they sorted that one... I still have to read through the documentation on that to understand what the story was behind that issue and how to avoid it in future.

Anyway, I modified one of the simple scripts and placed it in the Blogger Template to display Biff's Blogrolling list of links.

All worked fine until somebody pointed out to me that going into the Archives broke the RSS feed. It broke it because the link to the Magpie files was relative - I had been thinking in terms of the Index page and hadn't considered the Archive pages which are in subfolders.

I got around this problem using Bloggers Conditional Tags to ensure that the RSS feed only appears on the main Index page.

There is probably (or at least possibly) a way to include a link to the Magpie files which would not be relative to the Index page, but relative to the root - but so far my attempts have failed. More on this later if I resolve it.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home