Naveen's Blog

Software dev interested in .NET, windbg and anything on the way

Using Tech-Ed OData to download videos

with 8 comments

I wanted to watch the Teched 2010 videos, but the problem I had was going to the site manually to download files for offline viewing.  And I was also interested only in Dev sessions which were level 300 / 400. Thanks to OData for teched http://odata.msteched.com/sessions.svc/ ,I  could write 3 statements in linqpad and had them all downloaded using wget

File.Delete(@"C:\temp\download.txt");

Sessions
.Where (s => (s.Level.StartsWith("400") ||  s.Level.StartsWith("300") ) && s.Code.StartsWith("DEV"))
.Take(10)
.ToList()
.Select (s => @"http://ecn.channel9.msdn.com/o9/te/NorthAmerica/2010/mp4/" + s.Code + ".mp4" )
.Run(s => File.AppendAllText(@"C:\temp\download.txt",s + Environment.NewLine));

Util.Cmd(@"wget.exe -b -i c:\Temp\download.txt",true);

Forgot to mention for the Run extension method is from Reactive Extensions

Written by Naveen

June 15, 2010 at 8:20 am

Posted in linqpad, odata

8 Responses

Subscribe to comments with RSS.

  1. Am I missing an assembly I should add to LINQPad? Because I get an error on all of the StartsWith statements being invalid.

    J Wynia

    June 16, 2010 at 9:54 am

    • Sorry about that, It is was error in the code it should have been s.Level.StartsWith

      I have fixed it now.

      Naveen

      June 16, 2010 at 11:25 am

  2. What assembly is the Run method in? I can’t seem the execute the above.

    Thanks!

    // Dave

    Dave

    June 16, 2010 at 10:29 am

  3. Thanks. Forgot to mention , Run is from Reactive Extensions. I have updated the post with the information.

    Naveen

    June 16, 2010 at 11:26 am

    • i installed the Reactive Extensions for .NET 4, and added a reference in LinqPad (via Query Options) to System.Reactive.

      Am I missing something? It still can’t find the .Run method.

      Thanks!!!

      // Dave

      Dave

      June 16, 2010 at 6:41 pm

      • Actually I just got it.

        This is my first introduction to the Reactive Extensions.

        I was missing System.CoreEx and System.Interactive.

        I’ll have to check this out later. Maybe there is a TechEd session on it.

        Thanks again!

        // Dave

        Dave

        June 16, 2010 at 6:43 pm

      • I converted your magic into a WCF Syndication service so I could subscribe to it with the Zune software.

        http://davecorun.com/blog/2010/06/16/creating-a-teched-2010-wcf-syndication-feed/

        Thanks for the quick start!

        // Dave

        Dave

        June 16, 2010 at 8:10 pm

  4. [...] http://naveensrinivasan.com/2010/06/15/using-tech-ed-odata-to-download-videos/ [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.