Skip to content

Node.js wrapper for the Google Contacts API (uses OAuth 2.0 token authentication), repackaged for Meteor

Notifications You must be signed in to change notification settings

longliangyou/Meteor-Google-Contacts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 long: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

Node.js wrapper for the Google Contacts API (uses OAuth 2.0 token authentication), repackaged for Meteor

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%