Spaces:
Running
Running
Update app.py
Browse files
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.
|
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':
|
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 |
|