Skip to content

Instantly share code, notes, and snippets.

@lw
Created February 12, 2013 16:42
Show Gist options
  • Save lw/4771213 to your computer and use it in GitHub Desktop.
Save lw/4771213 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import sys
import time
import urllib.request
import hashlib
import subprocess
url = sys.argv[1]
def make_hash():
return hashlib.md5(urllib.request.urlopen(url).read()).digest()
hash = make_hash()
while True:
time.sleep(5)
if hash != make_hash():
subprocess.call(["zenity", "--notification", "--text=URL has been updated!"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment