Location via proxy:   [ UP ]   [Manage cookies]
Search

Displaying RSS Feeds on Your Site

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.



3 Responses to “Displaying RSS Feeds on Your Site”

  1. 48) { this.width = 48; this.height = 48; } ; if (this.width < 48) { this.parentNode.title = 'Iscriviti a MyBlogLog.com!'; this.src='http://www.mybloglog.com/buzz/images/pict_none.gif'; this.onload=void(null); }" alt="MyAvatars 0.2"/> dharak sandeep Says:

    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?

  2. 48) { this.width = 48; this.height = 48; } ; if (this.width < 48) { this.parentNode.title = 'Iscriviti a MyBlogLog.com!'; this.src='http://www.mybloglog.com/buzz/images/pict_none.gif'; this.onload=void(null); }" alt="MyAvatars 0.2"/> Dharak Sandeep Says:

    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 [email protected]

  3. 48) { this.width = 48; this.height = 48; } ; if (this.width < 48) { this.parentNode.title = 'Iscriviti a MyBlogLog.com!'; this.src='http://www.mybloglog.com/buzz/images/pict_none.gif'; this.onload=void(null); }" alt="MyAvatars 0.2"/> Shawn Says:

    Just grab an RSS feed from an website, like 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!

Leave a Comment