Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Commit

Permalink
Switched to use config file for google auth
Browse files Browse the repository at this point in the history
Author: @sembirayael
Author: @pbadenski
  • Loading branch information
Pawel Badenski authored and Pawel Badenski committed Aug 21, 2012
1 parent 0d15ce6 commit b8574fa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/narrative.rb
Expand Up @@ -11,8 +11,6 @@ module Collectors
class NarrativeCollector

API_SCOPE = "https://docs.google.com/feeds/ https://docs.googleusercontent.com/ https://spreadsheets.google.com/feeds/"
GOOGLE_CLIENT_ID = '1054017153726.apps.googleusercontent.com'
GOOGLE_CLIENT_SECRET = 'eMFsc8LU3ZGrRFG93WfQCnD3'

def initialize(authorization_code=nil)
@authorization_code = authorization_code
Expand Down Expand Up @@ -68,7 +66,7 @@ def response

def get_worksheet(authorization_code)
key = ENV['WORKSHEET'] || '0AhRGSTCqlCiqdDNiVXFsdmh6RVV5N1lENE14X3lTcmc'
authentication = GoogleAuthenticationBridge::GoogleAuthentication.new(API_SCOPE, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET)
authentication = GoogleAuthenticationBridge::GoogleAuthentication.create_from_config_file(API_SCOPE, '/var/tmp/google_credentials.yml')
token = authentication.get_oauth2_access_token(authorization_code)
session = GoogleDrive.login_with_oauth(token)
session.spreadsheet_by_key(key).worksheets[0]
Expand Down

0 comments on commit b8574fa

Please sign in to comment.