Created
November 1, 2016 21:14
-
-
Save AspenForester/4123d255b6b1d7a184c0653a36a04bff to your computer and use it in GitHub Desktop.
Parses the HTML for the 2017 PowerShell Summit Eventloom page and returns the current number of available seats. It was written very as a think-type-do exercise. Show me you can do better!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$url = "https://eventloom.com/event/home/summit2017" | |
$page = Invoke-WebRequest -Uri $url | |
$outertext = $page.ParsedHtml.getElementsByTagName("div") | where Classname -eq "col-md-6" | Select -ExpandProperty OuterText | |
$AvailableText = ($outertext -split '[\r\n]').Where({$_ -like "*avail*"}) | |
$SeatsAvailable = $AvailableText.Split(' ')[0] | |
$SeatsAvailable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is awesome, saves me from having to go out and check!
Just waiting for the approval to book!