Skip to content

Instantly share code, notes, and snippets.

@gonzalo
Created May 17, 2017 13:42
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 gonzalo/8c42aecb771369c569bfae61119bdb63 to your computer and use it in GitHub Desktop.
Save gonzalo/8c42aecb771369c569bfae61119bdb63 to your computer and use it in GitHub Desktop.
cryptomachine = Fernet(key)
with open(inputfile, 'r') as file:
while True:
token = file.read(blocksize)
if not token: break
encToken = cryptomachine.encrypt(token)
if args.verbose:
print encToken
if twitter_flag:
try:
twitter_api.PostUpdate(encToken)
except twitter.error:
print "Unable to post to twitter"
exit(1)
time.sleep(interval)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment