Skip to content

Instantly share code, notes, and snippets.

@mockmyberet
Created October 12, 2017 01:16
Show Gist options
  • Save mockmyberet/823d15c135f779909beaf06adba29c0e to your computer and use it in GitHub Desktop.
Save mockmyberet/823d15c135f779909beaf06adba29c0e to your computer and use it in GitHub Desktop.
Excuse Generator
function Get-Excuse
{
$url = 'http://pages.cs.wisc.edu/~ballard/bofh/bofhserver.pl'
$ProgressPreference = 'SilentlyContinue'
$page = Invoke-WebRequest -Uri $url -UseBasicParsing
$pattern = '<br><font size = "\+2">(.+)'
if ($page.Content -match $pattern)
{
$matches[1]
}
}
@mockmyberet
Copy link
Author

2017-10-11 20_15_18-windows powershell ise

@mockmyberet
Copy link
Author

mockmyberet commented Oct 12, 2017

(( Invoke-WebRequest -Uri http://pages.cs.wisc.edu/~ballard/bofh/excuses ).content -split '\n') | Get-Random -ea Ignore

Is another way

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