<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>PeteL's Blog : RSS</title><link>http://blogs.msdn.com/petel/archive/tags/RSS/default.aspx</link><description>Tags: RSS</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Generating OPML's with the RSS Platform</title><link>http://blogs.msdn.com/petel/archive/2007/02/16/generating-opml-s-with-the-rss-platform.aspx</link><pubDate>Sat, 17 Feb 2007 01:04:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1691651</guid><dc:creator>PeteL</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/petel/comments/1691651.aspx</comments><wfw:commentRss>http://blogs.msdn.com/petel/commentrss.aspx?PostID=1691651</wfw:commentRss><description>&lt;p&gt;Just before I headed up to Web Directions North, I wrote a little chunk of code to help me do a system back up.&amp;nbsp; Enough people at work have been losing data on their hard disks, so I decided I wasn't going to have that happen to me.&amp;nbsp; I picked up a NAS storage device, 2 500gig hard drives, and got it all set up at home.&amp;nbsp; It works quite nicely.&amp;nbsp; I set up SyncToy to back up all the data that I find important, and run daily or weekly.&amp;nbsp; &lt;/p&gt; &lt;p&gt;But one thing was not getting back up that I was a bit worried about.&amp;nbsp; My RSS feed list.&amp;nbsp; I couldn't find where the RSS platform stores the OPML list, or even if it does, so I figured, since it's an open platform, I'd just write a method that would create the OPML list for me!&amp;nbsp; Once I got the initial work done, it was really easy.&amp;nbsp; &lt;/p&gt; &lt;p&gt;So, I figured I'd share the code.&amp;nbsp; This code will return a string, that is the OPML list of all the feeds that you've subscribed to using the RSS Platform.&amp;nbsp; Sure you can just go into IE, and choose File/Export, but that's a manual process, I wanted something automatic.&lt;/p&gt;&lt;pre&gt;using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using Microsoft.Feeds.Interop;
using System.Collections.Specialized;

namespace BackupHelper
{
    class OPMLBuilder
    {
        public string Result
        {
            get
            {
                return sbResult.ToString();
            }
        }

        StringBuilder sbResult;

        public OPMLBuilder()
        {
            sbResult = new StringBuilder();
            sbResult.Append("&lt;opml version="\&amp;quot;1.1\&amp;quot;"&gt;\r\n &lt;head&gt;\r\n  \r\n \r\n \r\n");
            FeedsManager mgr = new FeedsManagerClass();
            IFeedFolder root = (IFeedFolder)mgr.RootFolder;
            BuildFeeds(root, 0);
            sbResult.Remove(sbResult.Length - 13, 13);
            sbResult.Append(" \r\n&lt;/opml&gt;\r\n");

        }
        public bool WriteOPML(string filename)
        {
            try
            {
                //Pass the filepath and filename to the StreamWriter Constructor
                StreamWriter sw = new StreamWriter(filename);

                //Write a line of text
                sw.WriteLine(sbResult.ToString());

                //Close the file
                sw.Close();
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }

        private void BuildFeeds(IFeedFolder parent, int n)
        {
            string spacing = new string(' ', n+1);
            if (n &amp;gt; 0)
            {
                sbResult.Append(spacing + "&lt;outline  ?\? + ?&amp;amp;?) parent.Name.Replace(?&amp;?, text='\""'&gt;\r\n");
            }

            foreach (IFeed feed in (IFeedsEnum)parent.Feeds)
            {
                sbResult.Append(spacing + " &lt;outline  ?&amp;amp;?) text='\""+' type='\"rss\"/' +?\? feed.Url xmlUrl='\""+' feed.Name.Replace(?&amp;?,&gt;\r\n");
            }

            foreach (IFeedFolder folder in (IFeedsEnum)parent.Subfolders)
                BuildFeeds(folder, n + 1);

            sbResult.Append(spacing + "&lt;/outline&gt;" + "\r\n");
        }
    }
}
&lt;/pre&gt;
&lt;p&gt;Hope some of you find that useful!&lt;/p&gt;
&lt;p&gt;Sorry it's taken so long to get it up, after getting back from Web Directions North, I seem to have gotten hit with some kind of cold/flu or something that has knocked my on my butt.&amp;nbsp; I've been at home all week.&amp;nbsp; I've done about 30 emails all week, and usually I'm about 50-80 a day!&amp;nbsp; If that gives you any idea of how I've been feeling.&amp;nbsp; Today is the first day I've felt somewhat human again.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1691651" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/petel/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/petel/archive/tags/Code+Samples/default.aspx">Code Samples</category><category domain="http://blogs.msdn.com/petel/archive/tags/share/default.aspx">share</category><category domain="http://blogs.msdn.com/petel/archive/tags/ie/default.aspx">ie</category><category domain="http://blogs.msdn.com/petel/archive/tags/Internet+Explorer/default.aspx">Internet Explorer</category><category domain="http://blogs.msdn.com/petel/archive/tags/Internet+Explorer+7/default.aspx">Internet Explorer 7</category><category domain="http://blogs.msdn.com/petel/archive/tags/RSS/default.aspx">RSS</category></item><item><title>Web Design World Session: IE7 From CSS to RSS: How to Take Full Advantage</title><link>http://blogs.msdn.com/petel/archive/2006/12/13/web-design-world-session-ie7-from-css-to-rss-how-to-take-full-advantage.aspx</link><pubDate>Wed, 13 Dec 2006 23:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1277486</guid><dc:creator>PeteL</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/petel/comments/1277486.aspx</comments><wfw:commentRss>http://blogs.msdn.com/petel/commentrss.aspx?PostID=1277486</wfw:commentRss><description>&lt;P&gt;I just finished my session titled "Internet Explorer 7 From CSS to RSS: How To Take Full Advantage" here at Web Design World, and it went over pretty well.&amp;nbsp; Cameron Moll is currently doing a session right now, so we did lose quite a few people to him, but he's an excellent speaker and is showing some really cool CSS and design stuff, so I understand why they're over there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I talked about some of the cool features around IE7, like what quirks mode is vs. standards mode; how to use RSS on your site, how to implement OpenSearch on your page, and then finally some of the cool CSS fixes that we made for IE7.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I've uploaded my slides along with this post so that the info can be shared.&amp;nbsp; I'm don't have the samples that I showed available, but much of the info that I showed is included in the slides.&amp;nbsp; If you're looking for something specific, let me know and I'll try to get it up there for you!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1277486" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/petel/attachment/1277486.ashx" length="889344" type="application/vnd.ms-powerpoint" /><category domain="http://blogs.msdn.com/petel/archive/tags/CSS+Examples/default.aspx">CSS Examples</category><category domain="http://blogs.msdn.com/petel/archive/tags/Code+Samples/default.aspx">Code Samples</category><category domain="http://blogs.msdn.com/petel/archive/tags/share/default.aspx">share</category><category domain="http://blogs.msdn.com/petel/archive/tags/ie/default.aspx">ie</category><category domain="http://blogs.msdn.com/petel/archive/tags/web+design/default.aspx">web design</category><category domain="http://blogs.msdn.com/petel/archive/tags/Internet+Explorer/default.aspx">Internet Explorer</category><category domain="http://blogs.msdn.com/petel/archive/tags/Internet+Explorer+7/default.aspx">Internet Explorer 7</category><category domain="http://blogs.msdn.com/petel/archive/tags/RSS/default.aspx">RSS</category><category domain="http://blogs.msdn.com/petel/archive/tags/presentations/default.aspx">presentations</category></item><item><title>A Quick Link To Extending RSS in IE7</title><link>http://blogs.msdn.com/petel/archive/2006/11/08/a-quick-link-to-extending-rss-in-ie7.aspx</link><pubDate>Thu, 09 Nov 2006 00:43:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1040118</guid><dc:creator>PeteL</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/petel/comments/1040118.aspx</comments><wfw:commentRss>http://blogs.msdn.com/petel/commentrss.aspx?PostID=1040118</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;One of the cool demos I saw around IE7 was how to extend the RSS platform so that you could include additional information, or provide additional ways of listing and sorting through data that you'd have in the RSS feed.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Sean Lyndersay on the RSS team pointed me to these links that I found really informative.&lt;/p&gt; &lt;p&gt;Generic RSS info: &lt;a href="http://msdn.microsoft.com/xml/rss/"&gt;http://msdn.microsoft.com/xml/rss/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Simple List Extension Example: &lt;a href="http://msdn.microsoft.com/xml/rss/sle/"&gt;http://msdn.microsoft.com/xml/rss/sle/&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1040118" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/petel/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/petel/archive/tags/share/default.aspx">share</category><category domain="http://blogs.msdn.com/petel/archive/tags/ie/default.aspx">ie</category><category domain="http://blogs.msdn.com/petel/archive/tags/web+design/default.aspx">web design</category><category domain="http://blogs.msdn.com/petel/archive/tags/Internet+Explorer/default.aspx">Internet Explorer</category><category domain="http://blogs.msdn.com/petel/archive/tags/Internet+Explorer+7/default.aspx">Internet Explorer 7</category><category domain="http://blogs.msdn.com/petel/archive/tags/RSS/default.aspx">RSS</category></item></channel></rss>