Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,16 +14,17 @@ AUTHORIZATION_BASE_URL = 'https://accounts.google.com/o/oauth2/v2/auth'
|
|
14 |
TOKEN_URL = 'https://www.googleapis.com/oauth2/v4/token'
|
15 |
SCOPES = ['https://www.googleapis.com/auth/webmasters.readonly']
|
16 |
|
|
|
|
|
|
|
|
|
17 |
# Streamlit UI
|
18 |
st.title("Search Analytics Viewer")
|
19 |
site_url = st.text_input("Enter your website URL:", "https://www.example.com")
|
20 |
start_date = st.date_input("Start Date")
|
21 |
end_date = st.date_input("End Date")
|
22 |
|
23 |
-
if st.button("
|
24 |
-
# Initiate OAuth Flow
|
25 |
-
google_oauth = OAuth2Session(CLIENT_ID, redirect_uri=REDIRECT_URI, scope=SCOPES)
|
26 |
-
authorization_url, state = google_oauth.authorization_url(AUTHORIZATION_BASE_URL, access_type="offline", prompt="select_account")
|
27 |
st.write("Please authenticate with Google:", authorization_url)
|
28 |
|
29 |
# Handle Redirect
|
|
|
14 |
TOKEN_URL = 'https://www.googleapis.com/oauth2/v4/token'
|
15 |
SCOPES = ['https://www.googleapis.com/auth/webmasters.readonly']
|
16 |
|
17 |
+
# Initiate OAuth Flow
|
18 |
+
google_oauth = OAuth2Session(CLIENT_ID, redirect_uri=REDIRECT_URI, scope=SCOPES)
|
19 |
+
authorization_url, state = google_oauth.authorization_url(AUTHORIZATION_BASE_URL, access_type="offline", prompt="select_account")
|
20 |
+
|
21 |
# Streamlit UI
|
22 |
st.title("Search Analytics Viewer")
|
23 |
site_url = st.text_input("Enter your website URL:", "https://www.example.com")
|
24 |
start_date = st.date_input("Start Date")
|
25 |
end_date = st.date_input("End Date")
|
26 |
|
27 |
+
if st.button("Authenticate with Google"):
|
|
|
|
|
|
|
28 |
st.write("Please authenticate with Google:", authorization_url)
|
29 |
|
30 |
# Handle Redirect
|