Class: Tact::GoogleContacts::Fetcher
- Inherits:
-
Object
- Object
- Tact::GoogleContacts::Fetcher
- Defined in:
- lib/tact/google_client.rb
Class Method Summary collapse
Class Method Details
.info_list ⇒ Object
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 |
.json ⇒ Object
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 |