From 8af7c676fb8a3d8377f74150b69aadc60593164e Mon Sep 17 00:00:00 2001 From: Adam Coddington Date: Sun, 1 Jun 2014 14:26:19 -0700 Subject: [PATCH] Remoing unaccessed 'fetch_contacts' function. --- django_mailbox/google_utils.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/django_mailbox/google_utils.py b/django_mailbox/google_utils.py index 4d6b773..b834f59 100644 --- a/django_mailbox/google_utils.py +++ b/django_mailbox/google_utils.py @@ -109,25 +109,3 @@ def fetch_user_info(email): "https://www.googleapis.com/oauth2/v1/userinfo?alt=json" ) return result - - -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 - ) - 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() - ] - contacts = [] - for each in valid_entries: - try: - name = each[u'gd$name'][u'gd$fullName'][u'$t'] - except KeyError: - name = None - for each_email in each[u'gd$email']: - contacts.append(dict(name=name, email=each_email[u'address'])) - return contacts