EricGEGE commited on
Commit
6fc4582
·
verified ·
1 Parent(s): 61e482b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -16,18 +16,21 @@ password = os.getenv('PASSWORD')
16
  SOCIAL_SHEET = 'SocialSheet'
17
 
18
  # Service account credentials file path
19
- CREDENTIALS_FILE = 'credentials.json'
20
 
 
 
 
21
  # Initialize Google Sheets client
22
  SCOPES = ['https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive']
23
- creds = Credentials.from_service_account_file(CREDENTIALS_FILE, scopes=SCOPES)
24
  gc = gspread.authorize(creds)
25
  sheet = gc.open_by_key(SHEET_ID)
26
 
27
  # API endpoint and request details
28
  url = "https://google.serper.dev/search"
29
  headers = {
30
- 'X-API-KEY': '9565be7ef86196d8852c5bd2416349201d7a362c',
31
  'Content-Type': 'application/json'
32
  }
33
 
 
16
  SOCIAL_SHEET = 'SocialSheet'
17
 
18
  # Service account credentials file path
19
+ # CREDENTIALS_FILE = 'credentials.json'
20
 
21
+ conf1 = os.getenv('CONF')
22
+ dict = json.loads(conf1)
23
+ XKEY = os.getenv('XKEY')
24
  # Initialize Google Sheets client
25
  SCOPES = ['https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive']
26
+ creds = Credentials.from_service_account_info(dict, scopes=SCOPES)
27
  gc = gspread.authorize(creds)
28
  sheet = gc.open_by_key(SHEET_ID)
29
 
30
  # API endpoint and request details
31
  url = "https://google.serper.dev/search"
32
  headers = {
33
+ 'X-API-KEY': XKEY,
34
  'Content-Type': 'application/json'
35
  }
36