Skip to content

Commit f484b34

Browse files
committed
rename gcs env variables to match use and add additional comment documentation
1 parent d6aa639 commit f484b34

File tree

2 files changed

+14
-34
lines changed

2 files changed

+14
-34
lines changed

env.example

+11-31
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,19 @@
1-
## photos.py & photos_detail.py
2-
# "The flickr developer guide: https://www.flickr.com/services/developer/"
1+
## GCS (Google Custom Search)
32

4-
# FLICKR_API_KEY =
5-
# FLICKR_API_SECRET =
6-
7-
8-
## deviantart_scratcher.py & google_scratcher.py
3+
# https://developers.google.com/custom-search/v1/introduction
94
# "Custom Search JSON API requires the use of an API key. An API key is a way
105
# to identify your client to Google."
11-
# https://developers.google.com/custom-search/v1/introduction
6+
#
7+
# https://googleapis.github.io/google-api-python-client/docs/epy/index.html
8+
# "string, key obtained from https://code.google.com/apis/console"
129

13-
# GOOGLE_API_KEYS = key1, key2
10+
# GCS_DEVELOPER_KEY =
1411

12+
# https://developers.google.com/custom-search/v1/reference/rest/v1/Search
1513
# "The identifier of an engine created using the Programmable Search Engine
1614
# Control Panel [https://programmablesearchengine.google.com/about/]"
17-
# https://developers.google.com/custom-search/v1/reference/rest/v1/Search
18-
19-
# PSE_KEY =
20-
21-
22-
## vimeo_scratcher.py
23-
# "Before we set you loose on the API, we ask that you provide a little
24-
# information about your app. An app in this sense can be a full-featured
25-
# mobile application, a dynamic web page, or a three-line script. If it's
26-
# making API calls, it's an app."
27-
# https://developer.vimeo.com/api/guides/start#register-your-app
28-
29-
# VIMEO_ACCESS_TOKEN =
30-
# VIMEO_CLIENT_ID =
31-
32-
33-
## youtube_scratcher.py
34-
# "Every request must either specify an API key (with the key parameter) [...].
35-
# Your API key is available in the Developer Console's API Access pane
36-
# [https://console.developers.google.com/] for your project."
37-
# https://developers.google.com/youtube/v3/docs
15+
#
16+
# https://googleapis.github.io/google-api-python-client/docs/dyn/customsearch_v1.cse.html
17+
# "string, The Programmable Search Engine ID to use for this request."
3818

39-
# YOUTUBE_API_KEY =
19+
# GCS_CX =

scripts/1-fetched/gcs_query.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
load_dotenv(PATHS["dotenv"])
3333

3434
# Constants
35-
API_KEY = os.getenv("GOOGLE_API_KEYS")
36-
CX = os.getenv("CUSTOM_SEARCH_ENGINE_ID")
35+
DEVELOPER_KEY = os.getenv("GCS_DEVELOPER_KEY")
36+
CX = os.getenv("GCS_CX")
3737
BASE_URL = "https://www.googleapis.com/customsearch/v1"
3838

3939
# Log the start of the script execution
@@ -46,7 +46,7 @@ def get_search_service():
4646
"""
4747
LOGGER.info("Getting Google Custom Search API Service.")
4848
return googleapiclient.discovery.build(
49-
"customsearch", "v1", developerKey=API_KEY, cache_discovery=False
49+
"customsearch", "v1", developerKey=DEVELOPER_KEY, cache_discovery=False
5050
)
5151

5252

0 commit comments

Comments
 (0)