Create an RSS Feed for PDC 2010 videos by ThinqLinq

Create an RSS Feed for PDC 2010 videos

I love the fact that Microsoft makes it’s conference materials available for those unfortunate enough not to be able to attend. I also love watching the videos on my Zune. Even better is when I can use the Zune podcasting ability to download these videos. So far, I wasn’t able to find such a feed. Thankfully, fellow MVP, Bill McCarthy posted some quick LINQ to XML code to generate HTML tables based on the Xessions XML that was used for PDC. You can read his post here: http://msmvps.com/blogs/bill/archive/2010/11/03/pdc-2010-sessions.aspx.

To take this a step further, I modified his code to generate a quick RSS feed that I can use in the Zune software to download them as if they were a podcast. Here’s the revised code:

Dim doc = XDocument.Load("http://videoak.microsoftpdc.com/pdc_schedule/Schedule.xml")
        Response.Write(<?xml version="1.0" encoding="UTF-8"?>
                       <rss version="2.0">
                           <channel>
                               <title>PDC Videos</title>
                               <link>http://www.Microsoftpdc.com</link>
                               <description>Download content files for PDC 2010.</description>
                               <generator>LINQ</generator>
                               <%= From session In doc...<Session>
                                   From content In session...<Content>
                                   Where content.@Url.EndsWith("Low.wmv")
                                   Select <item>
                                              <title><%= session.<ShortTitle>.Value & " - " & content.@Title %></title>
                                              <link><%= session.@ShortUrl %></link>
                                              <enclosure url=<%= content.@Url %>/>
                                          </item> %>
                           </channel>
                       </rss>)

 

Note: This code does require VB10. If you want to do it with VB9, just add the line continuators (_).

Posted on - Comment
Categories: Linq to XML - VB Dev Center -
comments powered by Disqus