Last active
April 7, 2018 13:12
-
-
Save michaelmcmillan/0702fb4238c8cf1aaf9ef8c96044b071 to your computer and use it in GitHub Desktop.
This file contains 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
from time import sleep | |
from subprocess import run, PIPE | |
def fetch(): | |
command = ['curl', 'https://demo.ctf.ninja/challenges/', '-H', 'Cookie: sessionid=*change-me*;'] | |
return run(command, stdout=PIPE).stdout | |
def notify(): | |
command = ['say', 'New challenge!'] | |
return run(command, stdout=PIPE) | |
if __name__ == '__main__': | |
old_html = fetch() | |
while True: | |
new_html = fetch() | |
if new_html != old_html: | |
old_html = new_html | |
notify() | |
sleep(60) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment