Spaces:
Sleeping
Sleeping
updated app.py
Browse files
app.py
CHANGED
@@ -8,12 +8,20 @@ from googleapiclient.discovery import build
|
|
8 |
import base64
|
9 |
from datetime import datetime, timedelta
|
10 |
|
|
|
11 |
# Gmail API scope
|
12 |
SCOPES = ['https://www.googleapis.com/auth/gmail.readonly']
|
13 |
|
14 |
-
#
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
# Keywords for filtering emails
|
19 |
KEYWORDS = {
|
|
|
8 |
import base64
|
9 |
from datetime import datetime, timedelta
|
10 |
|
11 |
+
# Gmail API scope
|
12 |
# Gmail API scope
|
13 |
SCOPES = ['https://www.googleapis.com/auth/gmail.readonly']
|
14 |
|
15 |
+
# Instead of reading from file, get credentials from environment variables
|
16 |
+
CLIENT_CONFIG = {
|
17 |
+
"installed": {
|
18 |
+
"client_id": os.environ.get('GOOGLE_CLIENT_ID'),
|
19 |
+
"client_secret": os.environ.get('GOOGLE_CLIENT_SECRET'),
|
20 |
+
"redirect_uris": ["urn:ietf:wg:oauth:2.0:oob"],
|
21 |
+
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
22 |
+
"token_uri": "https://oauth2.googleapis.com/token",
|
23 |
+
}
|
24 |
+
}
|
25 |
|
26 |
# Keywords for filtering emails
|
27 |
KEYWORDS = {
|