Skip to content

Instantly share code, notes, and snippets.

@bundyfx
Created October 11, 2015 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bundyfx/1d41c8c95898d6cdc158 to your computer and use it in GitHub Desktop.
Save bundyfx/1d41c8c95898d6cdc158 to your computer and use it in GitHub Desktop.
October 2015 Scripting Games (NBA RSS)
#Requires -Version 3.0
<#
.Synopsis
Get the latest updates on your favourite NBA teams!
.EXAMPLE
Get-RSSFeed -Team Lakers
.EXAMPLE
Get-RSSFeed Spurs
.NOTES
Why not combine two of my favourite things! PowerShell/NBA
#>
Function Get-RSSFeed {
Param
(
[Parameter(Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
[ValidateNotNullOrEmpty()]
[ValidateSet(
"Lakers",
"Bucks",
"Bulls",
"Spurs",
"Celtics",
"Clippers",
"Grizzlies",
"Hawks",
"Heat",
"Hornets",
"Jazz",
"Kings",
"Knicks",
"Magic",
"Mavericks",
"Nets",
"Nuggets",
"Pacers",
"Pelicans",
"Pistons",
"Raptors",
"Rockets",
"Sixers",
"Suns",
"Thunder",
"Blazers",
"Timberwolves",
"Warriors",
"Wizards",
"Cavaliers" )]
$Team
)
BEGIN {
}
PROCESS{
[xml]$x = Invoke-WebRequest "http://www.nba.com/$team/rss.xml" -DisableKeepAlive
$x.rss.channel.item.where({$_.link -notmatch 'espanol' -and $_.link -notmatch 'chinese'}) | Select Title,Link | Format-Table
}
END{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment