Google calendar sync
This commit is contained in:
22
eventplanner_gcal/googleapiTest/createCredentials.py
Normal file
22
eventplanner_gcal/googleapiTest/createCredentials.py
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
from oauth2client.client import OAuth2WebServerFlow
|
||||
from oauth2client.file import Storage
|
||||
|
||||
|
||||
flow = OAuth2WebServerFlow(client_id='34462582242-4kpdvvbi27ajt4u22uitqurpve9o8ipj.apps.googleusercontent.com',
|
||||
client_secret='y4t9XBrJdCODPTO5UvtONWWn',
|
||||
scope='https://www.googleapis.com/auth/calendar',
|
||||
redirect_uri='http://localhost')
|
||||
|
||||
createLink = False
|
||||
if createLink:
|
||||
auth_uri = flow.step1_get_authorize_url()
|
||||
print "AuthURI:"
|
||||
print auth_uri
|
||||
print "Visit this link - grab the key from the url and paste it into the else block"
|
||||
exit(0)
|
||||
else:
|
||||
code = "4/Iais8aK8_KxbMQjq3Rtw3PFXu6Nr.8itpukY_6ZgZOl05ti8ZT3ax27a3hAI"
|
||||
credentials = flow.step2_exchange( code )
|
||||
storage = Storage('calendarCredentials.dat')
|
||||
storage.put( credentials )
|
||||
Reference in New Issue
Block a user