Search
SEO Logs » blogging » rss » Displaying RSS Feeds on Your Site
  • No categories

  • Displaying RSS Feeds on Your Site

    Requirement: PHP
    Skill Level (1-10): 3

    RSSRSS 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!



    6 Responses to “Displaying RSS Feeds on Your Site”

    1. 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. 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 dharaksandeep@gmail.com

    3. MyAvatars 0.2 Shawn Says:

      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! :-)

    4. MyAvatars 0.2 shayne Says:

      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.

    5. MyAvatars 0.2 Gamer Says:

      How do i create my own rss feeds of my site?

    6. MyAvatars 0.2 Ted Says:

      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

    Leave a Comment