1
0
Fork 0

Minor cleanup & a Python 3k fix.

This commit is contained in:
Adam Coddington 2014-05-29 16:52:08 -07:00
parent e50408e365
commit 05c8d3ece8
2 changed files with 16 additions and 4 deletions

View file

@ -111,10 +111,14 @@ def fetch_user_info(email):
def fetch_google_contacts(email, limit=10000):
result = google_api_get(
email,
"https://www.google.com/m8/feeds/contacts/default/full?v=3.0&alt=json&max-results=%s" % limit
"https://www.google.com/m8/feeds/contacts/default/full"
"?v=3.0&alt=json&max-results=%s" % limit
)
entries = result['feed']['entry']
valid_entries = [x for x in entries if u'gd$email' in x.keys() and u'gd$name' in x.keys()]
valid_entries = [
x for x in entries
if u'gd$email' in x.keys() and u'gd$name' in x.keys()
]
contacts = []
for each in valid_entries:
try: