Skip to content

Instantly share code, notes, and snippets.

@JustinGrote
Last active May 31, 2023 15:27
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 JustinGrote/9f636570dddd07f8e6d727c73b8a8112 to your computer and use it in GitHub Desktop.
Save JustinGrote/9f636570dddd07f8e6d727c73b8a8112 to your computer and use it in GitHub Desktop.
PAX Watcher Script
Write-Host -fore green '===PAX CHECKER==='
Write-Host -fore green '===This will open a browser to the ticket window if PAX goes on sale==='
$result = $null
do {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Write-Host -fore gray "$(Get-Date): Checking ShowClix for PAX"
$paxEvents = (Invoke-RestMethod -Headers @{'Cache-Control' = 'max-age=0'} 'https://www.showclix.com/rest.api/Partner/48/events').psobject.properties.value |
Where-Object { $PSItem.event -match 'PAX' -and $PSItem.event -notmatch 'BYOC|Special|Media|Exhibitor' }
$result = $paxEvents |
Where-Object {
[datetime]$PSItem.date_added -ge (Get-Date).AddDays(-1)
} |
Foreach-Object listing_url
if ($result) {
Write-Host -fore Green '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
Write-Host -fore Green "***ITS PAX TIME!*** Opening $($result -join ',') in 3 new browser windows or tabs"
Write-Host -fore Green '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
[media.soundplayer]::New('C:\Windows\media\Alarm01.wav').PlayLooping()
$result | ForEach-Object {
$url = $PSItem
0..3 | ForEach-Object {
Start-Process $url
}
}
} else {
Write-Host -fore Gray 'No Pax For Now :( Checking again in 1 second...'
Start-Sleep 1
}
} while (-not $result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment