Author Topic: How To Display An XML Feed On Your Website  (Read 847 times)

0 Members and 1 Guest are viewing this topic.

Offline Perfect

  • Cokoye
  • *****
  • Posts: 8275
  • Gender: Male
    • View Profile
    • Africa Online Forums Nigeria | Ghana forum| Kenya Communites| Uganda
Really Simple Syndication (RSS) has taken off in a big way. Just as satellite television beams more channels in your home that you can see, RSS can display an infinite amount of content from other people. While RSS XML feeds are plenty, there is much in the way of clear and simple when it comes to making use of feeds.

If you are one of the webmasters that uses a content management system that facilitates the use of XML RSS feeds as easy as specifying a feed URL, then we are fortunate in that regard. For others, the options tend to be offered by the developers of the software and instructions for use provided can often be full of technical jargon. Many cry, "I use my food", but less will tell you how.

One of the best and easiest ways I've found to display the contents of a XML RSS feed in one of my websites is to use a ready made PHP parser. Now, do not worry about what this means, just think of it as somthing that someone has already created a black box that makes it easy for you to use content from RSS feeds and display on your website.

For this tutorial, I used MagpieRSS because it is compact, works well and is distributed under the GPL, which basically means it is free for you to use. Now, MagpieRSS is written in PHP so you need a compatible hosting account allows you to run PHP scripts.

For the purposes of this guide, I'm assuming you have some basic knowledge about websites eg you know how to FTP, change file permissions, and so covers the basics of running a website is beyond the scope of this article.

Instead, we'll cover what are probably the most difficult steps, which displays the contents of an RSS feed on your website.

1. Download the latest stable release of MagpieRSS.
2. Extract the contents of the ZIP file on your computer.
3. Database files you need from the postal package rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc. You also need the extlib folder with the file within the same Snoopy.class.inc.
4. Create a new file to display your RSS feed. I called mine, index.php. Within this file, copy and paste the file contents are listed below and save it.
5. Upload all files and folder mentioned in steps 3 and 4 to your hosting account. Put them in the desired location, but make sure the file is still Snoopy.class.inc within the extlib folder.
6. Then visit the file you created in step 4 using your web browser.

That's the basics of it. Once you've gotten this far, customizing the way of presenting the content of the source is relatively easy. It only refers to the MagpieRSS website for guidance on how to do this.


 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name: Email:
Verification:
Type fifty as a number:

Related Topics