Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I use my Gmail contacts within Alpine/pine?

share|improve this question

An alternate way of importing your Google contacts is using

This script will:

  1. perform a GData query to retrieve all the contacts; and
  2. print them in alpine's addressbook format.

So, to add all of your Google contacts to the addressbook, simply:

  python >> .addressbook

The main advantage of this method over the one described by DaveParillo is the added support for non-latin1 characters. If you're like me and have a lot of people with accented letters in their names, this script is a God-send -- you won't have to go through the list manually replacing ? with the right latin1 letter.

Note that the script requires the GData libraries.

share|improve this answer
+1 For a nice and clean output – Ayman Elmasry Feb 5 '12 at 23:06
Ah. I now use goobook, for what it's worth. It's an abook clone that uses Google contacts. – scvalex Feb 8 '12 at 10:37
Doesn't work for me. It seems, since the last post made, gmail moved forward: gdata.service.RequestError: {'status': 301, 'body': '<HTML>\n<HEAD>\n<TITLE>Moved Permanently</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Moved Permanently</H1>\nThe document has moved <A HREF="">he‌​re</A>.\n</BODY>\n</HTML>\n', 'reason': 'Moved Permanently'} – Zhang Weiwu Jun 9 '14 at 6:20

I don't think you can just 'reach out' and use them on the fly, but you can append them to your existing ~/.addressbook

  1. in GMail, choose 'Contacts', then 'Export' in the upper right corner
  2. choose 'Outlook CSV' & save
  3. open it in a spreadsheet
  4. delete first line, insert a column before the others
  5. Save As -> Text export (configurable)
    • in the upcoming dialog choose:
    • Separator: Tab
    • Never Quote
  6. Save file
  7. append this file to your .addressbook-file.

    cat gmailfile.csv >> ~/.addressbook

share|improve this answer

I found a much easier method!

Go to your contacts in google, and copy the entire contacts (ie, two columns, with names in first, and address in second, leave the "Name" and "Details" row)

Now, go to your home folder, and unhide by Ctrl+h. Open the .addressbook file.

Simply paste and save.

Open your alpine, and check!

Most will not need the following step.

For formatting and aligning, you may first create one contact through alpine, and then open your addressbook file. you will see your entry. Then paste and separate through tab accordingly.

share|improve this answer
I can't figure out exactly how to select and copy the text as described, neither in the the "old" nor "new" interface. I might just be stupid, or this answer may no longer work. – Brian Z Nov 8 '15 at 2:23

You must log in to answer this question.