Wednesday, July 06, 2005


I was reading a blog from a guy on the Monad team and saw this snippet. Monad (or MSH) is the next command-line from Microsoft. It's a dynamic scripting language. It reminds me of some sort of mix of Bash, PHP, Perl and .NET. I just had my ah-ha moment:

foreach ($f in $feeds) { 


    # read the content from $feeduri as XML 

    $wc = new-object System.Net.WebClient 
    $s = $wc.OpenRead($feeduri) 
    $sr = new-object System.IO.StreamReader($s) 
    $rssdata = [xml]$sr.ReadToEnd() 

    # display title 
    write-host $

    # display title and date of each item 

    $ | 
        foreach-object { 
            write-host "-" $_.title 
            write-host "     " $_.pubDate 


Look at how Monad allows you to use .NET objects. Also note the implicit xml support; you can navigate the DOM as if it were an object ($ Very cool.

No comments: