nkg / Meteor-Google-Contacts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Meteor wrapper for the Google Contacts API, based on Lajos Koszti's Node library, and unfortunately quite a few commits behind it. PR's welcome.

Install

meteor add google-contacts

Usage

opts =
  email: userEmail
  consumerKey: googleId
  consumerSecret: googleSecret
  token: googleAccessToken
  refreshToken: googleRefreshToken

gcontacts = new GoogleContacts opts

gcontacts.refreshAccessToken opts.refreshToken, (err, accessToken) ->
  if err
    console.log 'gcontact.refreshToken, ', err
    return false
  else
    console.log 'gcontact.access token success!'
    gcontacts.token = accessToken
    gcontacts.getContacts (err, contacts) ->
      // Do what you want to do with contacts
      // console.log(contacts);

    gcontacts.getPhoto contact.photoUrl, (err, binaryData) ->
      // Save binaryData to you DB or file.

About


Languages

Language:JavaScript 100.0%