forked from mirror/django-mailbox
Minor cleanup & a Python 3k fix.
This commit is contained in:
parent
e50408e365
commit
05c8d3ece8
2 changed files with 16 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue