Skip to content

Instantly share code, notes, and snippets.

@michaelmcmillan
Last active April 7, 2018 13:12
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 michaelmcmillan/0702fb4238c8cf1aaf9ef8c96044b071 to your computer and use it in GitHub Desktop.
Save michaelmcmillan/0702fb4238c8cf1aaf9ef8c96044b071 to your computer and use it in GitHub Desktop.
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