Interested in building your own Gadgets for Live.com?

Ok, so I must admit that the whole Live.com/Start.com thing looks so much like a “Digital Dashboard” (anyone else get into that fad when it was cool?) that I feel like I’m back working on building my own components into the Outlook Today page…. but cynicism aside, it is still a cool idea and the very open system for creating and adding your own gadgets rocks. If you are wondering how to get started, then check out Adam Kinney’s article to learn exactly what you need to do.

Beta versions of the MSDN home page now available…

I’ve been working (as part of a large team!) on the new platform for MSDN, which is up and running at http://msdn2.microsoft.com… and now you can see prototype versions of the MSDN home page ontop of that same platform. Check it out here [http://beta.msdn.microsoft.com/default.aspx]. The new home page demonstrates some of the personalization/profile features that will end up on the final MSDN site in the near future.

application/rss+xml vs. text/xml

I’ve been working on some feed support in MSDN’s new online platform (a beta of which is running http://msdn2.microsoft.com) and I had to decide what content-type to use when outputting a RSS feed. I knew this was a contentious issue in the past, but I thought it might have been resolved so I did some browsing of specs and discussions and ended up with the following links:

I’m sure I could find more, but it appears this was never really resolved… using application/xml seems the most ‘proper’, but the concern is that some browsers don’t know how to handle it … so the other choice is text/xml (specifically text/xml; charset=utf-8 or else the charset will default to US-ASCII). Hmm… which to choose? Even our own sites have multiple implementations:

Interestingly enough, I found one feed that used application/rss+xml (Sam’s RSS 2.0 feed) which I think is probably not the best choice since that content type was never officially registered, and it was the only feed I hit that IE didn’t understand (and therefore tried to just download).

I think I will go with “application/xml” which has the best features in my opinion.

  • It clearly indicates that this is not just text, so it should avoid issues with proxies messing with the characters,
  • it leaves the character set data in the xml declaration, avoiding a possible conflict if I specify one in the http headers that is different than what the feed specifies,
  • it displays correctly in IE and Firefox, and
  • it is consistent with what we are doing today with the MSDN main feed.

Now, what about those in-page links we have? <link rel=”alternate” type=”application/rss+xml” title=”blah” href=”rss.xml” /> …. perhaps they should be just “application/xml” as well?

More on that RSS editor…

In the end, MSDN didn’t end up needing the RSS editor I wrote, so I’ve stripped out the features and content specific to their needs and started turning it into a more generic RSS creation tool. If you’d like to see it, as it is, you can run it from a ClickOnce install point here on my site. There are more features coming, and I’m revamping the style and behavior of the category system…. but you can try it out against copies of your own feeds or click File | New Feed to make new ones. Check out the Validate option on the menu, it will send whatever feed you have open to a web service enabled version of the feedvalidator.org system (coded up by Kent Sharkey), allowing you to check the validatity of your RSS without having to publish the file anywhere.

Note: If you have Beta 2 of the .NET Framework installed, the Click Once application will not install or run correctly. In this case, you need to run the VS remove tool (available from here)

Just spent way too much time fixing VB code coloring on MSDN2

You may have already noticed this, but the current build of MSDN2 has a bug in the way it colors VB code snippets, as you can see here (scroll down, there are quite a few problems in the code snippet coloring, see how many you can spot!)… turns out the code wasn’t handling comments right, text in quotes, and it didn’t have a full list of the VB keywords (so MsgBox was not recognized, for example). I’ve fixed it all up now (I think) so that code will work its way through review and test then get added to some not-too-distant update of the site code… but for now, here is the revised output for those particular code samples.

Broken

' Imports statements must be at the top of a module.
Imports Microsoft.VisualBasic.CallType
Sub TestCallByName1()
    'Set a property.
    CallByName(TextBox1, "Text", CallType.Set, "New Text")

    'Retrieve the value of a property.
    MsgBox(CallByName(TextBox1, "Text", CallType.Get))

    'Call a method.
    CallByName(TextBox1, "Hide", CallType.Method)
End Sub
Public Sub TestCallByName2()
    Dim col As New Collection()

    'Store the string "Item One" in a collection by 
    'calling the Add method.
    CallByName(col, "Add", CallType.Method, "Item One")

    'Retrieve the first entry from the collection using the 
    'Item property and display it using MsgBox().
    MsgBox(CallByName(col, "Item", CallType.Get, 1))
End Sub

Fixed

' Imports statements must be at the top of a module.
Imports Microsoft.VisualBasic.CallType
Sub TestCallByName1()
    'Set a property.
    CallByName(TextBox1, "Text", CallType.Set, "New Text")

    'Retrieve the value of a property.
    MsgBox(CallByName(TextBox1, "Text", CallType.Get))

    'Call a method.
    CallByName(TextBox1, "Hide", CallType.Method)
End Sub
Public Sub TestCallByName2()
    Dim col As New Collection()

    'Store the string "Item One" in a collection by 
    'calling the Add method.
    CallByName(col, "Add", CallType.Method, "Item One")

    'Retrieve the first entry from the collection using the 
    'Item property and display it using MsgBox().
    MsgBox(CallByName(col, "Item", CallType.Get, 1))
End Sub

RSS feed authoring for those without blog software or an enjoyment of typing angle brackets

Blogs and blogging software seem to be everywhere these days, and RSS has been a top buzzword for quite some time, everyone and their dog wants to take advantage of this new trend and technology. The problem is, it isn’t a simple process to create and maintain a valid RSS file. If you aren’t willing to run a complete blogging system or if you aren’t capable of hand-editing XML, then you don’t have a lot of options. For most of the folks that will read this blog entry, you probably don’t have this problem, producing RSS 2.0 wouldn’t be much of an issue for a developer, but there are times when we want less technical folks to be able to author their own feeds without any assistance. At MSDN we started thinking about this very problem ourselves recently when we decided that, in addition to all the feeds that come out of our content systems, there was a need to create some small feeds that didn’t necessarily fit into our larger content systems. Handing off the task of feed creation to notepad or Front Page wasn’t an appealing thought and that path would probably result in a lot of xml editing errors and invalid feeds.

This problem happened to line up with a sample I had been thinking of though, so I wrote a quick app using VC# Express 2005 to try and help out; a Feed Writer that allows you to create new RSS 2.0 feeds, edit existing ones, and even import entries from one feed to another. I stuck to a tried and true UI structure, tree along the left side then entry fields on the right:

This app has been developed without the general user in mind, MSDN/TechNet were the targets and because of that there are some fields in this UI that are only relevant to the needs of those groups. For example, the list of attributes you can see on the lower-right is specific to the needs of MSDN and TechNet, who need to markup the feed entries with the appropriate choices. The “Type” and “HeadlineImage” fields are also specific to MSDN feeds, I’m planning to adapt it to work with ‘standard’ RSS 2.0 items and the category element to make it more general purpose, but for now I thought I’d show you the version I already have running.

In a rather backwards fashion, I’m going to finish up this as a sample and write the article, now that I’ve finished the actual practical version of the same system… but it will all work out in the end.

After some discussions with Sam Ruby and others on the FeedValidator mailing list, the MSDN RSS feed validates as is…

In an earlier post, I discussed the fact that the MSDN feeds were failing to validate due to a MIME type that included parameters (charset in this case, like ‘text/html ;charset=utf-8’), but I also posted a query about this issue into the listserv for FeedValidator.org. Sam mentioned it on his blog, and then went ahead and updated the validator to recognize a MIME type with parameter as valid.

In the meantime, I updated the MSDN generator to strip out the parameters :), but I still think they are technically valid so I’m glad the feed validates as it is today (with params) and as it will exist in the near future with the MIME types stripped down to just type/subtype.