Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - Migrating a Blog using Dmitryr's ASP.Net Rss
A simple programmers blog
 
# Friday, March 03, 2006
My old Jonsie.net domain is due to expire sometime soon so I thought it was about time I saved the 1 or 2 interesting posts I made there. The old site uses .Text so I could easily grab the posts from the SQL DB, but I thought it would be more fun to use RSS.  I remember Scott Guthry posting recently about the ASP.Net RSS Toolkit so I downloaded it to have a play.
 
First thing I tried was to RTFM but for some reason this word doc keeps exploding and taking Word with it.  A quick copy and paste to a new document fixed that (Word's document recovery was less than helpful!).  The 'manual' is a little sparse, but it gives enough pointers to get your started.
 
There are several ways you can access the RSS feed.  I wanted to create a simple WinForms or Console app to do this job so I tried using the Rssdl.exe tool to create a strongly typed channel feed.  Unfortunately our Nazi firewall got in the way and the RssToolkit doesn't know anything about firewalls.  After a bit of a search around the code I found the source of the problem in RssDownloadManager.DownloadChannelDom().  It was using WebClient to make the call to DownloadData but without first configuring the proxy.  So, I changed this to:
 

    1             // download the feed

    2             WebClient wc = new WebClient();

    3             wc.Proxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

    4             byte[] feed = wc.DownloadData(url);

 

This is adequate for this UI application but for a more robust solution you may need to modify this to allow a user name, password and proxy string to be passed in somehow. 

 

So, now I executed the Rssdl.exe too to create the class. This created jonsie.cs for me.  I then created a simple console app to dump the title of all the items on the blog:

 

    1 using System;

    2 using System.Collections.Generic;

    3 using System.Text;

    4 

    5 using RssToolkit;

    6 

    7 namespace JonsieExtract

    8 {

    9   class Program

   10   {

   11     static void Main(string[] args)

   12     {

   13       jonsieChannel jc = jonsieChannel.LoadChannel();   

   14 

   15       foreach (jonsieItem ji in jc.Items)

   16       {

   17         Console.WriteLine(ji.Title);

   18       }

   19       Console.ReadLine();

   20 

   21     }

   22   }

   23 }

 

Which produced this:

 

 

Cool!  Oh, crap.  I only get the last 15 posts.  I need all of them.  Oh yeah, this is a setting in .Text.  So I log to my old site and .. hang on, where's the admin options?

 

 

IE 7 has problems displaying the tabs.  Fortunatly I have a spare machine with IE6.  I set the Default number of posts on the home page/feed to 115 and click save.  And wait.  And wait. And wait.  Bum.  Looks like .Text is as useful as ever.  Oh well, part 2 another day.

Friday, March 03, 2006 3:36:01 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General  | 
Comments are closed.
Copyright © 2012 Peter G Jones. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: