10
6
How can I use my Gmail contacts within Alpine/pine?
10
6
How can I use my Gmail contacts within Alpine/pine?
4
An alternate way of importing your Google contacts is using pull_contacts.py.
This script will:
So, to add all of your Google contacts to the addressbook, simply:
python pull_contacts.py aphacker@gmail.com >> .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.
2
You can use this short piece of PYTHON code to extract the relevant columns from the Google CSV (use Export.. on Google Contacts Website). It also takes care of the translation from UTF-16 to your ISO locale.
import io
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import csv
a=io.open("google.csv",'r',encoding="utf-16")
r=csv.reader(a,quotechar='"')
for b in r:
if b[28] <> "":
print "\t"+b[0]+"\t"+b[28]
Call it as in:
python google.py >~/.addressbook
Getting this: Traceback (most recent call last): File "google.py", line 9, in <module> for b in r: File "/usr/lib/python2.7/codecs.py", line 314, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) File "/usr/lib/python2.7/encodings/utf_16.py", line 67, in _buffer_decode raise UnicodeError("UTF-16 stream does not start with BOM") UnicodeError: UTF-16 stream does not start with BOM – Regmi – 2019-01-28T04:25:29.717
2
I don't think you can just 'reach out' and use them on the fly, but you can append them to your existing ~/.addressbook
append this file to your .addressbook-file.
cat gmailfile.csv >> ~/.addressbook
1
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.
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 – 2015-11-08T02:23:56.450
Ah. I now use goobook, for what it's worth. It's an abook clone that uses Google contacts. – scvalex – 2012-02-08T10:37:19.427
2Doesn'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="https://www.google.com/m8/feeds/contacts/default/full?max-results=1000">here</A>.\n</BODY>\n</HTML>\n', 'reason': 'Moved Permanently'}
– Tankman六四 – 2014-06-09T06:20:34.900