Last active
December 24, 2015 17:49
-
-
Save arsatiki/6838649 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
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