I would like to just throw a shout out to the authors of the goobook python script – it’s the nicest gmail contact integration I’ve seen so far. The big killer feature is that it caches the results, so it’s fast and doesn’t get in the way. You’ll also want the example.py they have one the google page as an example to put your account information in. To use it in mutt put it some place and add it to your muttrc like so:
set query_command = “/home/jorge/contactos.py ‘%s’”
and then set some keybindings (I prefer tab to the default ctrl-t):
bind editor <Tab> complete-query
bind editor ^T complete
Now every time you hit tab it will autocomplete with your gmail contacts … Ctrl-T will query your local aliases if you have those. I prefer to keep everything in my gmail anyway so I don’t use that last one. Thanks to Kyle Rankin and Rick Harding helping find and configure this.
When I try to use goobook I get the following:
python Configs/mutt/contactos.py
Traceback (most recent call last):
File “Configs/mutt/contactos.py”, line 8, in
from gdata.contacts.service import ContactsService, ContactsQuery
ImportError: No module named contacts.service
I’m thinking that it could because the version of gdata in the ubuntu repo is 1.0.9 and the most recent version is 1.2.4. What did you do to get it to work.
Never mind. Turns out that I’m an idiot. I didn’t copy the ‘%s’ into my .muttrc.
Excellent tip. On hardy I had to search for the python gdata contacts module but, after that it works great in mutt.
I have been using goobook for a while now, however I still think I prefer the Little Brother Data Base or just using the Mutt text based address book to add names manually. With LBDB, I can setup LDAP with a global address book and also use the Google address book, or any other address book that I may use. With my personal accounts I do use goobook most of the time.
I’m searching all over for details on setting up lbdb to check google contacts, and google isn’t coming through. Could you share something on your setup with lbdb and google contacts?
thanks for the link to this cool script I can’t wait to see more features in it
It turns out i’m a real idiot. Even when copy ‘%s’ into my .muttrc i still got the error:
File “Configs/mutt/contactos.py”, line 8, in
from gdata.contacts.service import ContactsService, ContactsQuery
ImportError: No module named contacts.service
I am sure i have installed the package python-gdata (1.0.9-1ubuntu1).
I’m using Ubuntu 8.10
I have also place the right settings in the file settings.py in my home directory
Any hints?
Maybe it’s just me, but when I tried to use it, it would always cut off the first result, so searches with only one return would be blank, I had to go in and edit the file, add a new line character right before line 27 (the for (k,v) statement). I believe its because Mutt strips the first line of query returns (which I read somewhere else a while ago) and so it was stripping the first result. Now it seems to work perfectly. Cool script!
Michael: you need to have the gdata python lib installed. download the latest version from: http://code.google.com/p/gdata-python-client/downloads/list and you should be good to go.
@Nick August :
Thanks! It’s working now!
I have this installed and from command line I can query my contacts and get them just fine but when in Mutt and query an addy, I don’t get the return for an address I know is there when I hit tab.
Any ideas?
Wow! what an idea ! What a concept ! Beautiful .. Amazing
my God, i thought you were going to chip in with some decisive insght at the end there, not leave it with we leave it to you to decide.
Hello. I just want to check: does goobook send unencrypted password on the net, or does it use ssl somehow?
Super-Duper site! I am loving it!! Will come back again – taking you feeds also, Thanks.
Thank you to you as well as the goobook developers.
Thoughtful post and well written. Please write more on this if you have time.
I guess I agree with you but maybe if you explained it just a little more I could learn more. Thanks in advance.
Anybody know if I wanted to bookmark your blog do I have to set-up an account for NewsVine?
Hello, I think this is the coollest wordpress powered blog I`ve seen. I really like your theme
noob question: i pasted
-set query_command = “/directory_path/contactos.py ‘%s’”-
into .muttrc, but get the following when i run mutt:
‘%s’”: unknown variable
what’s wrong?
also, where does the settings_example.py come into play?
some help would be appreciated.
many thanks!
hmm…was getting that error in gnome terminal, but not in rxvt. still a terminal noob (in both senses). ignore my above ??s
[...] Ahh, agora sim… Mutt sincronizando os contatos com o Gmail http://castrojo.wordpress.com/2009/01/28/gmail-contacts-with-mutt/ [...]
@Scott,
You need to retype the double ” and single ‘ quotes in the setquery line to straight quotes, not the prettified curly quotes displayed on the blog page.
thanks for that!
Great plugin!
bit i use imaps, does it fetch adress book through imap, or does anyone can sniff my login/password with a simple hub?
This is just GREAT!
Thanks!
This script works nicely at home, I get all my contacts. However, at work I am behind a proxy. I tried to look at the gdata api docs, but I couldnt see any obvious place where I could set the proxy.
Does anyone know hot to do that?
thanks,
bjorn
You should be able to add these to your .bashrc or .profile:
export http_proxy=”:”
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export all_proxy=$http_proxy
export no_proxy=”localhost, 127.0.0.1″
it should should use these variables, but it may not.
Cool site, nice content
Yeah! Thanks a lot!
Jorge- This isn’t working for me, and there are no errors. Everything is in its place- contactos.py, settings.py and the Python Google library. Hitting the key does not complete any contacts, and ~/.goobook_cache does not get created unless I create it manually, at which point it does get filled with some random data, it seems, but no contacts. Not sure if there is a bug, or what, but no dice here.
Cancel that. Moving everything into ~/.mutt/ works. Shrug. Very nice. Thanks.