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