How can I setup a RSS FEED correctly?

Discussion in 'HTML & Website Design' started by The_Hermit_1971, Feb 26, 2009.

  1. #1
    I want to include a RSS FEED from my merchant in my site but I'm not able to do it correctly. I have tried some tutorials found in the net but never was able to make it work. This forum solved a few problems before so I'm posting this here to see if I finally find the solution. Thanks in advance.



    I mean, what should I do with the code they supplied?
     
    The_Hermit_1971, Feb 26, 2009 IP
  2. BlueBadger

    BlueBadger Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    We need a few more details. What platform are you on? What server side technogy are you using? (PHP, ASP, ASP.NET, Java). If you are using PHP setting up an RSS feed can be pretty simple but you'll need to know a little about what you are doing first. Theres a class you can use which will do it for you which is this ...
    
    <?php
    class RSSFeed {
    function getFeed($site_title, $site_description, $copyright_details, $feed_items, $domain=false){
    if (!$domain) $domain = $_SERVER["SERVER_NAME"];
    $feed = "<?xml version="1.0" encoding="UTF-8"?>
    ";
    $feed .= "<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
    ";
    $feed .= "<title>$site_title</title>
    <description>$site_description</description>
    <link>http://$domain</link>
    <copyright>$copyright_details</copyright>
    ";
    foreach ($feed_items as $item) {
    $item["EpochPublishDate"] = date("D, d M Y H:i:s O", $item["EpochPublishDate"]);
    $feed .= "<item>
    <guid>http://$domain" . $item["ItemAbsoluteURL"] . "</guid>
    <title>" . $item["ItemTitle"] . "</title>
    <description>" . $item["ItemDescription"] . "</description>
    <link>http://" . $_SERVER["SERVER_NAME"] . $item["ItemAbsoluteURL"] . "</link>
    <pubDate>" . $item["EpochPublishDate"] . "</pubDate>
    </item>
    ";
    }
    $feed .= "</channel>
    </rss>";
    return $feed;
    }
    }
    ?>
    
    PHP:
    Thats what I use for my RSS feeds and theres an atom version too. I got it from www.dev-explorer.com/articles/dynamic-rss-feed and theres some more information on there which may help you out. They also offer some advice on atom feeds if you want one of those too.

    Hope this is somewhere in the ballpark

    Badger
     
    BlueBadger, Feb 27, 2009 IP
  3. The_Hermit_1971

    The_Hermit_1971 Member

    Messages:
    94
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thanks for your reply. I have a PHP file and a URL provided by the merchant. What should I do with that? Can I send them to you so you get the information you need from them?
     
    The_Hermit_1971, Feb 27, 2009 IP