For the benefit of the person who came looking for information on “how to put an xml feed on your webpage” and because I’ve been offering a few XML RSS goodies recently, here’s a little guide I wrote so don’t worry, be happy!
One of the best and easiest ways I’ve found to show the content from an RSS XML feed on one of my websites is to use a ready made PHP parser. Now, don’t worry about what that means, just think of it as something that someone has already created; a blackbox that makes it easy for you to use content from RSS feeds and display it any way you want.
For this example, I’ve used MagpieRSS because it’s compact, works well and is distributed under the GPL, which basically means it’s free for you to use. Now, MagpieRSS is written in PHP so you’ll need a compatible hosting account that allows you to execute PHP scripts.
For the purposes of this guide, I’m assuming you’ve some level of basic knowledge about websites e.g. you know how to FTP, change file permissions etc. I guess you wouldn’t be reading this right now if you weren’t comfortable with these things!
Okay, on with the tutorial:
- Download the latest stable release of MagpieRSS.
- Extract the contents of the ZIP file onto your computer.
- The core files you need from the ZIP package are rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc. You’ll also need the extlib folder together with the Snoopy.class.inc file inside of it.
- Create a new file to display your RSS feed. I’ve called mine, index.php. Inside this file, copy and paste the contents of this file and save it.
- Upload all of the files and the folder mentioned in steps 3 and 4 to your hosting account. Put them into the desired location, but ensure that the Snoopy.class.inc file is still within the extlib folder.
- Then visit the file you created in step 4 using your web browser e.g. the example I’ve created in this tutorial is here.
That’s the basics of it. Once you’ve got this far, customising the way you present the content of the feed is relatively easy. Just refer back to the MagpieRSS website or drop a comment here and I’ll help if I can.
Don’t forget to get your free XML feed generator