Skip to content

Instantly share code, notes, and snippets.

@AspenForester
Created November 1, 2016 21:14
Show Gist options
  • Save AspenForester/4123d255b6b1d7a184c0653a36a04bff to your computer and use it in GitHub Desktop.
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!
$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
@drewjanderson
Copy link

This is awesome, saves me from having to go out and check!

Just waiting for the approval to book!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment