What led me down this path? Well, for some reason the geniuses at Google decided to make it very difficult to delete or select all of your messages. Using a browser, you are only able to select 10 at a time. On a mobile device, using an application, it is even more painful. I did some digging around and found pygooglevoice. It allows you to utilize the Google Voice API via Python. Most these will only operate on 10 messages at a time, however that is easily rectified with multiple calls or some better python programming than I know.

You need to have python installed to execute these scripts. I used these on a CentOS 6 system.

Software: http://code.google.com/p/pygooglevoice/

Installation/Configuration:

# yum install python python-setuptools
# easy_install simplejson
# easy_install -U pygooglevoice
# cd /usr/lib/python2.6/site-packages/pygooglevoice-0.5-py2.6.egg/googlevoice
# vi settings.py

# JGZ – Updated login URL since default did not work
#LOGIN = ‘https://www.google.com/accounts/ServiceLoginAuth?service=grandcentral’
LOGIN = ‘https://accounts.google.com/ServiceLogin?service=grandcentral’

Script samples to use the module:

Delete all read messages from your inbox:

from googlevoice import Voice

voice = Voice()
voice.login(‘GOOGLEVOICELOGIN’, ‘PASSWORD’)

for message in voice.inbox().messages:
if message.isRead:
message.delete()

Delete all read messages from your trash:

from googlevoice import Voice

voice = Voice()
voice.login(‘GOOGLEVOICELOGIN’, ‘PASSWORD’)

for message in voice.trash().messages:
if message.isRead:
message.delete()

Mark all unread messages as read:

from googlevoice import Voice,util

voice = Voice()
voice.login(‘GOOGLEVOICELOGIN’, ‘PASSWORD’)

while True :
folder = voice.search(‘is:unread’)
if folder.totalSize <= 0 : break util.print_(folder.totalSize) for message in folder.messages: util.print_(message) message.delete(1)

Script sample usage:

# python gvscriptname