Skip to content

Instantly share code, notes, and snippets.

@arsatiki
Last active December 24, 2015 17:49
Show Gist options
  • Save arsatiki/6838649 to your computer and use it in GitHub Desktop.
Save arsatiki/6838649 to your computer and use it in GitHub Desktop.
def touch(filename):
open(filename, 'a').close()
def fetch():
r = requests.get(SOURCE)
s_new = hashlib.sha1(r.content).digest()
touch('checksum')
f = open('checksum', 'r+')
s_old = f.read(20)
f.seek(0)
f.write(s_new)
f.close()
return r.text, s_new != s_old
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment