Class: Tact::GoogleContacts::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/tact/google_client.rb

Class Method Summary collapse

Class Method Details

.info_listObject



140
141
142
143
144
145
146
147
# File 'lib/tact/google_client.rb', line 140

def self.info_list
  info = JSON.parse(json, symbolize_names: true)
  if info[:error]
    puts "ERROR: Please authorize your Google account.".red 
    exit
  end
  info[:connections]  
end

.jsonObject



149
150
151
152
# File 'lib/tact/google_client.rb', line 149

def self.json
  `curl -H "$(oauth2l header --json #{CLIENT_SECRET} https://www.googleapis.com/auth/contacts https://www.googleapis.com/auth/contacts.readonly)"\
    https://people.googleapis.com/v1/people/me/connections?requestMask.includeField=person.names,person.phone_numbers,person.email_addresses`
end