8000 script to find github users by email · thouis/numpy-trac-migration@2b04348 · GitHub
[go: up one dir, main page]

Skip to cont 8000 ent

Commit 2b04348

Browse files
committed
script to find github users by email
0 parents  commit 2b04348

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

dump_emails.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# build map of email to github username
2+
import sqlite3
3+
from github import Github
4+
import getpass
5+
6+
u = raw_input("Github username: ")
7+
p = getpass.getpass("Password: ")
8+
g = Github(u, p)
9+
del p
10+
11+
conn = sqlite3.connect("numpy-trac.db")
12+
c = conn.cursor()
13+
outf = open("EMAIL_TO_GITHUB.txt", "w")
14+
badf = open("BAD_EMAILS.txt", "w")
15+
for (email,) in c.execute('SELECT value FROM session_attribute WHERE name="email"').fetchall()[:2]:
16+
print "Looking up", email
17+
try:
18+
user = g.legacy_search_user_by_email("thouis")
19+
outf.write("%s %s\n" %(email, user.name))
20+
print "%s %s\n" % (email, user.name)
21+
except Exception, e:
22+
print e
23+
badf.write("%s\n" % email)

0 commit comments

Comments
 (0)
0