-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGoogleAPI
More file actions
25 lines (19 loc) · 703 Bytes
/
GoogleAPI
File metadata and controls
25 lines (19 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/python
import time
import gdata.spreadsheet.service
spr_client = gdata.spreadsheet.service.SpreadsheetsService()
spr_client.email = 'email@gmail.com'
spr_client.password = 'senha'
spr_client.source = 'Teste planilha'
spr_client.ProgrammaticLogin()
spreadsheet_key = '0AgSORFi7G0POdGZxS3VKQUU1YVhMTkloOEVCVC1mcnc'
worksheet_id = 'od6'
dicionario = {}
dicionario['nome'] = raw_input("Nome: ")
dicionario['email'] = raw_input("E-mail: ")
dicionario['telefone'] = raw_input("Telefone: ")
entry = spr_client.InsertRow(dicionario, spreadsheet_key, worksheet_id)
if isinstance(entry, gdata.spreadsheet.SpreadsheetsList):
print "Linha inserida com sucesso"
else:
print "Linha nao inserida"