Monday, September 13, 2010

Subscribing to RSS Feeds

Using the Microsoft.FeedsManager we can easily subscribe to RSS feeds:

$fm = New-Object -ComObject Microsoft.FeedsManager

Lets look at the properties:








We want to work with RootFolder:











FeedFolder.CreateFeed(name,url)

Creates feed in folder and subscribes to it. Lets test it out by subscribing to my blog:

$fm.RootFolder.CreateFeed("Get-Command","http://get-command.blogspot.com/feeds/posts/default")


Now lets have some fun, for those who follow @ScriptingGuys recently they have been
sharing links to popular PowerShell blogs, here is how you can subscribe to,
if not all, most of them



$PoshURLs = @{
"Development in a Blink" = "http://feeds.feedburner.com/DevelopmentInABlink";
"Get-PowerShell" = "http://get-powershell.com/feed/";
"get-powershellblog" = "http://marcoshaw.blogspot.com/rss.xml";
"Huddled Masses" = "http://huddledmasses.org/feed/";
"Jonathan Medds Blog" = "http://www.jonathanmedd.net/feed";
"jonoble Blog" = "http://www.jonoble.com/blog/rss.xml";
"Nivot Ink" = "http://www.nivot.org/SyndicationService.asmx/GetRss";
"out-web.net" = "http://feeds.feedburner.com/Out-webnet";
"PowerScripting Podcast" = "http://feeds.feedburner.com/Powerscripting";
"PowerShell Script Repository" = "http://poshcode.org/feed";
"PowerShell with a Purpose" = "http://feeds.feedburner.com/winblog/pspurpose";
"PowerShell.CA" = "http://www.energizedtech.com/atom.xml";
"PowerShell.com" = "http://powershell.com/cs/blogs/MainFeed.aspx";
"Richard Siddaways Blog" = "http://richardsiddaway.spaces.live.com/feed.rss";
"Shay Levy" = "http://feeds.feedburner.com/ShayLevy";
"TechProsaic" = "http://feeds.feedburner.com/halr9000";
"The PowerShell Guy" = "http://thepowershellguy.com/blogs/posh/rss.aspx";
"Windows PowerShell Blog" = "http://blogs.msdn.com/powershell/rss.xml"
}

$PoshURLs.GetEnumerator() | % {$fm.RootFolder.CreateFeed($_.Name,$_.Value)}

No comments:

Post a Comment