Skip to content

Ajnasz/Google-Contacts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Class for Node.js to download google contacts as json

How to use:

$ npm install https://github.com/Ajnasz/Google-Contacts
var GoogleContacts = require('Google-Contacts').GoogleContacts,
    util = require('util');
var c = new GoogleContacts({
    email: '[email protected]',
    password: 'password'
});
c.on('error', function (e) {
    console.log('error', e);
});
c.on('contactsReceived', function (contacts) {
    console.log('contacts: ', util.inspect(contacts, {depth:null}));
});
c.on('contactGroupsReceived', function (contactGroups) {
    console.log('groups: ', util.inspect(contactGroups, {depth:null}));
});
c.getContacts({
    projection: 'thin',
    'max-results': 100
});
c.getContactGroups({
    projection: 'thin',
    'max-results': 200
});

_getContacts()_ and _getContactGroups()_ can get the following parameters:

other functionallities coming soon..

Contact Stream

You can handle contacts as streams.

var module = require('Google-Contacts'),
    cfg = {
        email: '[email protected]',
        password: 'password',
        test_contact_id: '12345' // you can parse contact id from contacts list
    };

contactGroupsStream = new module.GoogleContactsGroupsStream({
    email: cfg.email,
    password: cfg.password
});

contactStream = new module.GoogleContactStream({
    email: cfg.email,
    password: cfg.password,
    contactId: cfg.test_contact_id
});

contactsStream = new module.GoogleContactsStream({
    email: cfg.email,
    password: cfg.password
});


contactGroupsStream.pipe(process.stdout);
contactsStream.pipe(process.stdout);
contactStream.pipe(process.stdout);

About

Retreives contatct list

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •