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
import hashlib | |
def gravatar_url(email, size=120): | |
h = hashlib.new('md5') | |
h.update(email) | |
email_md5 = h.hexdigest() | |
gravatar = 'https://www.gravatar.com/avatar/{}.jpg?s={}'.format(email_md5, size) | |
return gravatar |
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
for row, line in enumerate(open('cred', 'r')): | |
splitting = line.split('|') | |
if len(splitting) == 6: | |
uid = splitting[0].rstrip('-') | |
username = splitting[2].lstrip('-').rstrip('-') | |
pwhash = splitting[3].lstrip('-').rstrip('-') | |
print {'uid': uid, 'username': username, 'hash': pwhash} |
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 python | |
#-*- coding:utf-8 -*- | |
import imaplib | |
import getpass | |
import argparse | |
argparser = argparse.ArgumentParser(description="Dump a IMAP folder into .eml files") | |
argparser.add_argument('-s', dest='host', help="IMAP host, like imap.gmail.com", required=True) | |
argparser.add_argument('-u', dest='username', help="IMAP username", required=True) |
NewerOlder