Last active
September 28, 2023 13:11
-
-
Save danielroedl/a321a5567e26578fae892b3fc8abf7e0 to your computer and use it in GitHub Desktop.
Simple Windows PowerShell web crawler
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
# Run once with a PowerShell as Admin to allow execution of script: | |
# set-executionpolicy remotesigned | |
# CONFIG | |
$URL = https://badlands.cc | |
$SEARCH_FOR = "BADLANDS 2024 INFORMATION COMING SOON3" | |
$WAIT_SECONDS = 10 | |
# CONFIG-END | |
Add-Type -AssemblyName PresentationCore,presentationFramework | |
While ($true) { | |
$WebResponse = Invoke-WebRequest $URL | |
$found = $WebResponse.ToString() -split "[`r`n]" | Select-String $SEARCH_FOR | |
if (! $found) { | |
[System.Windows.MessageBox]::Show("'$SEARCH_FOR' not found on page $URL!`n`nClick OK to open Browser and end the check script.","Content changes",0) | |
start $URL | |
break | |
} | |
$date = Get-Date | |
echo "${date}: '$SEARCH_FOR' found in $URL" | |
Start-Sleep -Seconds $WAIT_SECONDS | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment