This script is intended for extracting contact's addresses from a specified set of Google Apps users. To do that, it connects to the Google Contacts API version 3.0 and iterates over the passed list of accounts.
gcontacts-extractor.py [-d=<domain>] [-s] [-k] (-f | <source-accounts> ...)
- Create a service account in Google Apps console and paste
service_account_keys.jsonin the settings folder. - Authorize the contacts scope for the service account:
https://www.google.com/m8/feeds/. - Copy sample config files and remove their
.sampleextension. - Set default_domain in
conf.inias your Google Apps domain. - Run
gcontacts-extractor.py -s bob jack sallynote*. - You've got
bob.txt,jack.txtandsally.txttext files containing all of their mail addresses.
note* → the domain here is implied since it is previously defined in conf.ini, so when you write bob the script is actually understanding bob@yourdomain.com and so on.
-h --help
-d --domain=<domain> override default domain
-s --separated send output to separated files (per account)
-k --keep keep previous results on the output folder
-f --from-file get source accounts from file instead of from arguments
