X-Git-Url: http://git.maemo.org/git/?p=theonering;a=blobdiff_plain;f=src%2Fgvoice%2Fbackend.py;h=1973676e797aeb688d1cab7c40c9575ab9589c1b;hp=d910f4bb0d32779a29c2a520f9bf32d7443c29ef;hb=f0f60516546a57c6edce80e9bf8f7efa40a8da82;hpb=e1953e4e9ca771f000e9e54b05c260c383c00b99 diff --git a/src/gvoice/backend.py b/src/gvoice/backend.py index d910f4b..1973676 100755 --- a/src/gvoice/backend.py +++ b/src/gvoice/backend.py @@ -188,6 +188,7 @@ class GVoiceBackend(object): self._XML_ACCOUNT_URL = SECURE_URL_BASE + "contacts/" # HACK really this redirects to the main pge and we are grabbing some javascript self._XML_CONTACTS_URL = "http://www.google.com/voice/inbox/search/contact" + self._CSV_CONTACTS_URL = "http://mail.google.com/mail/contacts/data/export" self._XML_RECENT_URL = SECURE_URL_BASE + "inbox/recent/" self.XML_FEEDS = ( @@ -305,6 +306,9 @@ class GVoiceBackend(object): self._lastAuthed = time.time() return True + def persist(self): + self._browser.save_cookies() + def shutdown(self): self._browser.save_cookies() self._token = None @@ -497,6 +501,15 @@ class GVoiceBackend(object): page = self._get_page(self._XML_CONTACTS_URL) return self._process_contacts(page) + def get_csv_contacts(self): + data = { + "groupToExport": "mine", + "exportType": "ALL", + "out": "OUTLOOK_CSV", + } + contacts = self._get_page(self._CSV_CONTACTS_URL, data) + return contacts + def get_voicemails(self): """ @blocks @@ -965,6 +978,7 @@ def grab_debug_info(username, password): ("isdnd", backend._isDndURL), ("account", backend._XML_ACCOUNT_URL), ("contacts", backend._XML_CONTACTS_URL), + ("csv", backend._CSV_CONTACTS_URL), ("voicemail", backend._XML_VOICEMAIL_URL), ("sms", backend._XML_SMS_URL),