Results 1 to 6 of 6
  1. #1
    Affiliate Manager
    Join Date
    July 11th, 2008
    Posts
    41
    Creation of RSS Feeds ???
    Hey All,

    I am having another task of creating RSS Feeds and have found it to be quite time consuming by creating them by hand. Is there any way of creating RSS Feeds in a timely fashion? I am new to this so It would be a great help to have a place to start. Is there a software for this that could be compatible with a csv file? Anything around these lines would help. Thanks all!

  2. #2
    Member
    Join Date
    January 18th, 2005
    Posts
    155
    This reminded me!! I bought software that was Data Feed to RSS way back last July 2007 for only $29.95 (special offer I think) but do NOT know how to use Datafeeds, never asked for a refund, so still have it, somewhere on a computer that crashed! I'm not an affiliate or anything - the link is datafeedtorss {dotcom} - I do know that from my Palpay receipt.

    Or you could Google the words - datafeed, etc.

    Hope this will help you. Hope I can get into the old PC I've got buried somewhere and figure things out, again.

  3. #3
    Full Member markschok's Avatar
    Join Date
    January 18th, 2005
    Posts
    269
    Webmerge could handle this. I would imagine most people use webmerge to take a CSV file and create it as HTML but there should be no real difference in using it to set up a template for XML instead.

    On a server a PHP script could handle this, read in each line of CSV and output as an XML record adding on the header and footers where appropriate.

    Other than that MS office could have a go at this as a simple mail-merge for creating the main body of the XML document then pasting this inbetween a header and footer and then saving the whole lot as text only file with an XML extension. You could even use the date function in MS word to update the feed-published date.

  4. #4
    Full Member
    Join Date
    October 22nd, 2006
    Posts
    200
    I have software that may be usefull. My email address is in my profile.

  5. #5
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    It wouldn't be hard for me to add an extension to WebMerge to make this a very simple task, but I could use a little guidance about the specifics.

    For example, do you want to convert an entire CSV feed to RSS? That seems like a lot of data, probably more than most folks would care to read.

    So how would you ideally like to select the subset of records for your RSS? Inidividually select records, get all from a given category, the first N number of records, etc?
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  6. #6
    Full Member
    Join Date
    October 22nd, 2006
    Posts
    200
    I've had a few requests for a copy of the script. In fact there are two the first is for affiliates using a standard SAS pipe separated file use ?affid=xxxxx to add your user id or alter the $_GET['affid'] in the script to hard code it.

    As Fourthworld has said you really need a filter to get a subset or the xml feed will simply be too large.

    PHP Code:
    <?php
    $filename
    ="16187.txt";
    $timezone="EDT";
    $xml='<?xml version="1.0" encoding="utf-8"?>'."\r\n";
    $xml.='<rss version="2.0">'."\r\n";
    $xml.='<channel>'."\r\n";
    $xml.='<title>TITLE</title>'."\r\n";
    $xml.='<link>http://www.yourwebsite.com</link>'."\r\n";
    $xml.='<description>FEED description</description>'."\r\n";
    $xml.='<language>en-US</language>'."\r\n";
    $xml.='<pubDate>'.date("D, d M Y H:i:s ").$timezone.'</pubDate>'."\r\n";
    $xml.='<lastBuildDate>'.date("D, d M Y H:i:s ").$timezone.'</lastBuildDate>'."\r\n";
    $xml.='<docs>http://blogs.law.harvard.edu/tech/rss</docs>'."\r\n";
    $xml.='<managingEditor>editor@example.com</managingEditor>'."\r\n";
    $xml.='<webMaster>webmaster@example.com</webMaster>'."\r\n";
    ///end user changes
    $fpfopen ($filename,"r");
    while (
    $data=fgetcsv($fp,8192,"|",'"')){
    $data[4]=str_replace("YOURUSERID",$_GET['affid'],$data[4] );
    $xml.='<item>'."\r\n";
    $xml.='<title><![CDATA[';
    $xml.=$data[1]." $".$data[7];
    $xml.=']]></title>'."\r\n";
    $xml.='<description><![CDATA['."\r\n";
    $xml.=$data[11];
    //$xml.=strip_tags($data[11]);
    $xml.=']]></description>'."\r\n";
    $xml.='<enclosure url="'.$data[6].'" type="image/jpeg"  />'."\r\n";
    $xml.='<link><![CDATA['.$data[4].']]></link>'."\r\n";
    $xml.='</item>'."\r\n";
    }
    $xml.='</channel>'."\r\n";
    $xml.='</rss>'."\r\n";
    header("Content-type: application/xml");    
    //header('Content-Disposition: attachment; filename="rss.xml"');
    echo $xml;
    ?>
    You need to change the lines before ///end user changes to suit your site.

    Swap the comment "//" in the lines refering to $data[11] if you want to strip the html from the description and uncomment header('Content-Disposition: attachment; filename="rss.xml"'); if you want a file download.

    The second script is for merchants using the feed that they supply for upload to SAS. It works the same in principle but it takes a csv file and the column order is slightly different.

    PHP Code:
    <?php
    $filename
    ="merchant.csv";
    $timezone="EDT";
    $xml='<?xml version="1.0" encoding="utf-8"?>'."\r\n";
    $xml.='<rss version="2.0">'."\r\n";
    $xml.='<channel>'."\r\n";
    $xml.='<title>TITLE</title>'."\r\n";
    $xml.='<link>http://www.yourwebsite.com</link>'."\r\n";
    $xml.='<description>FEED description</description>'."\r\n";
    $xml.='<language>en-US</language>'."\r\n";
    $xml.='<pubDate>'.date("D, d M Y H:i:s ").$timezone.'</pubDate>'."\r\n";
    $xml.='<lastBuildDate>'.date("D, d M Y H:i:s ").$timezone.'</lastBuildDate>'."\r\n";
    $xml.='<docs>http://blogs.law.harvard.edu/tech/rss</docs>'."\r\n";
    $xml.='<managingEditor>editor@example.com</managingEditor>'."\r\n";
    $xml.='<webMaster>webmaster@example.com</webMaster>'."\r\n";
    $fpfopen ($filename,"r");
    while (
    $data=fgetcsv($fp,8192,",",'"')){
    $xml.='<item>'."\r\n";
    $xml.='<title><![CDATA[';
    $xml.=$data[1]." $".$data[4];
    $xml.=']]></title>'."\r\n";
    $xml.='<description><![CDATA['."\r\n";
    $xml.=$data[10];
    //$xml.=strip_tags($data[10]);
    $xml.=']]></description>'."\r\n";
    $xml.='<enclosure url="'.htmlentities($data[5]).'" type="image/jpeg"  />'."\r\n";
    $xml.='<link><![CDATA['.$data[2].']]></link>'."\r\n";
    $xml.='</item>'."\r\n";
    }
    $xml.='</channel>'."\r\n";
    $xml.='</rss>'."\r\n";
    header("Content-type: application/xml");
    header('Content-Disposition: inline; filename="rss.xml"');
    //header('Content-Disposition: attachment; filename="rss.xml"');
    echo $xml;
    ?>
    It should not be too difficult to adapt this script to handle any csv feed.

    Regards
    Bob

  7. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. rss feeds
    By tsmgroup2 in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: November 13th, 2006, 06:46 PM
  2. RSS Feeds
    By suzigeek in forum ShareASale - SAS
    Replies: 1
    Last Post: November 2nd, 2005, 10:36 PM
  3. RSS feeds
    By SandraR in forum Midnight Cafe'
    Replies: 4
    Last Post: February 28th, 2004, 07:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •