Displaying RSS Feeds on Your Site
- Posted by Badi Jones on March 7th, 2006 - Comment on this Post »
Requirement: PHP
Skill Level (1-10): 3
RSS feeds are an easy way to keep fresh new content on your site with. I have actually seen sites made up entirely of RSS feeds, like http://www.newsninja.net/.
The “Recent Articles” section on the left column of this site is actually an RSS feed from this site (created by WordPress).
I’m sure that may have seen some sites offering to generate an RSS feed for you, but they usually find some way to sneak a link back to their site in the feed. So they act as a middle-man, taking their cut in the form of a permanent backlink.
It really is just as easy to set this up on your own and bypass the middle man. Here’s how.
1. Download the latest version of Magpie RSS. (just click on the Download link at the top of the page). The current version is magpierss-0.72.tar.gz. Stuffit expander should be able to expand the folder.
2. Open the folder. There is a lot of stuff in there, but you will only need 5 of them.
- Make a new folder called ‘magpierss’
Copy rss_fetch.inc, rss_parser.inc, rss_cache.inc, rss_utils.inc, and the directory extlib into the new ‘magpierss’ folder.
3. Upload this folder into the directory of your site with whatever page(s) you want to publish / display RSS feeds on.
4. Start adding feeds. I think the best thing to do is just give you an example of what to add to your page. (rember, this page must be able to parse php, this usually means that the page should have a .php extension, ie: page.php.)
<?php
require_once ‘magpierss/rss_fetch.inc’;
$url = ‘http://www.seologs.com/feed/’;
$rss = fetch_rss($url);foreach ($rss->items as $item ) {
$title = $item[title];
$url = $item[link];echo “<li><a href=’$url’ class=’leftmenu’><b>$title</b></a></li>\n”;
}?>
And that’s it. The only part you would need to change is the rss feed url:
$url = ‘http://www.seologs.com/feed/‘;
So if you have a travel site, you might use http://www.usatoday.com/repurposing/TravelRss.xml
instead. So it would look like:
$url = ‘http://www.usatoday.com/repurposing/TravelRss.xml‘;
There is a lot more you can do with this. Even if you don’t have any experience with php, you should be able to change the look of the feed with simple html tags.
If you want to experiment with more features, check out the magpie documentation.
Have fun.
If you enjoyed this post, make sure you subscribe to my RSS feed!

July 7th, 2007 at 8:27 pm
I need one trick to create rss feed of any url. is there any trick, software or coading for making rss feed form any url?
October 1st, 2007 at 4:21 am
Hi SEO.
do you know about any software which can generates RSS feeds from URL.
if u know then please inform me that from where i can download it?
my mail id is dharaksandeep@gmail.com
November 9th, 2007 at 9:07 am
Just grab an RSS feed from an website, like http://www.Reuters.com , and syndicate that into your .php RSS reader and upload the <?php code onto your site with the RSS feed in it and you’re all set!
January 13th, 2008 at 5:04 pm
I would like to add news content to my site, http://www.click4itnow.com.
Some of the tricks mentioned here have not worked for me.
March 11th, 2008 at 11:05 am
How do i create my own rss feeds of my site?
August 28th, 2008 at 5:16 pm
For those wondering how to create feeds, just enter in Google the phrase ‘create rss from url’ and then you might click on the first result, like I did (I have no relation to the site) = http://www.masternewmedia.org/news/2006/03/09/how_to_create_a_rss.htm