msgbartop
Everybody get your shell on!
msgbarbottom

Reading an RSS feed with Powershell

This is a pretty cool (but mostly useless) PowerShell script that uses the System.Net.Webclient class and the DownloadString method. It pulls an RSS feed string from a URL into an XML formatted variable, and then pipes the Rss.Channel.Item property (which is where the meat of the RSS feed is held in the variable) into the format-table commandlet using the Title and Link properties of the feed to format the table.

1
2
3
[xml]$XMLRss = (new-object net.webclient).DownloadString("http://0direction.com/blog/index.php/feed/")
 
$XMLRss.rss.channel.item| format-table title,link

What you should end up with is a nicely formatted table containing the title’s of the last 10 of my blog posts, and links to the corresponding posts.
RSSTable

  • Twitter
  • Facebook
  • LinkedIn
  • Digg
  • Google Bookmarks
  • Slashdot
  • StumbleUpon
  • Live
  • FriendFeed
  • Ping.fm
  • Print
  • email
  • PDF
  • RSS

Tags:

Leave a Comment