Created
February 12, 2013 16:42
-
-
Save lw/4771213 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
#!/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