Skip to content

Commit efcb807

Browse files
committed
Add global env.example and rename env variables
1 parent f25a2c9 commit efcb807

12 files changed

Lines changed: 51 additions & 40 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ modules:
5151
### Running Scripts that Require Client Credentials
5252
5353
To successfully run scripts that require client credentials, you will need to follow these steps:
54-
1. Copy the contents of the `example.env` file in the script's directory to `.env`:
54+
1. Copy the contents of the `env.example` file in the script's directory to `.env`:
5555
```
56-
cp example.env .env
56+
cp env.example .env
5757
```
5858
2. Uncomment the variables in the `.env` file and assign values as needed. See [`sources.md`](sources.md) on how to get credentials:
5959
```
60-
API_KEYS=your_api_key
60+
GOOGLE_API_KEYS=your_api_key
6161
PSE_KEY=your_pse_key
6262
```
6363
3. Save the changes to the `.env` file.

deviantart/deviantart_scratcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
load_dotenv(dotenv_path)
2323

2424
today = dt.datetime.today()
25-
API_KEYS = os.getenv("API_KEYS").split(",")
25+
API_KEYS = os.getenv("GOOGLE_API_KEYS").split(",")
2626
API_KEYS_IND = 0
2727
DATA_WRITE_FILE = (
2828
f"{CWD}" f"/data_deviantart_{today.year}_{today.month}_{today.day}.csv"

deviantart/example.env

Lines changed: 0 additions & 9 deletions
This file was deleted.

env.example

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## photos.py & photos_detail.py
2+
# "The flickr developer guide: https://www.flickr.com/services/developer/"
3+
4+
# FLICKR_API_KEY =
5+
# FLICKR_API_SECRET =
6+
7+
8+
## deviantart_scratcher.py & google_scratcher.py
9+
# "Custom Search JSON API requires the use of an API key. An API key is a way
10+
# to identify your client to Google."
11+
# https://developers.google.com/custom-search/v1/introduction
12+
13+
# GOOGLE_API_KEYS = key1, key2
14+
15+
# "The identifier of an engine created using the Programmable Search Engine
16+
# 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
38+
39+
# YOUTUBE_API_KEY =
40+
41+

flickr/photos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
def main():
1818
flickr = flickrapi.FlickrAPI(
19-
os.getenv("API_KEY"), os.getenv("API_SECRET"), format="json"
19+
os.getenv("FLICKR_API_KEY"), os.getenv("FLICKR_API_SECRET"), format="json"
2020
)
2121

2222
# use search method to pull general photo info under each cc license data

flickr/photos_detail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def main():
153153
hs_csv_path = os.path.join(CWD, "hs.csv")
154154

155155
flickr = flickrapi.FlickrAPI(
156-
os.getenv("API_KEY"), os.getenv("API_SECRET"), format="json"
156+
os.getenv("FLICKR_API_KEY"), os.getenv("FLICKR_API_SECRET"), format="json"
157157
)
158158
# below is the cc licenses list
159159
license_list = [1, 2, 3, 4, 5, 6, 9, 10]

google_custom_search/example.env

Lines changed: 0 additions & 9 deletions
This file was deleted.

google_custom_search/google_scratcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
load_dotenv(dotenv_path)
2323

2424
today = dt.datetime.today()
25-
API_KEYS = os.getenv("API_KEYS").split(",")
25+
API_KEYS = os.getenv("GOOGLE_API_KEYS").split(",")
2626
API_KEYS_IND = 0
2727
DATA_WRITE_FILE = (
2828
f"{CWD}"

vimeo/example.env

Lines changed: 0 additions & 7 deletions
This file was deleted.

vimeo/vimeo_scratcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
load_dotenv(dotenv_path)
2525

2626
today = dt.datetime.today()
27-
ACCESS_TOKEN = os.getenv("ACCESS_TOKEN")
28-
CLIENT_ID = os.getenv("CLIENT_ID")
27+
ACCESS_TOKEN = os.getenv("VIMEO_ACCESS_TOKEN")
28+
CLIENT_ID = os.getenv("VIMEO_CLIENT_ID")
2929
DATA_WRITE_FILE = (
3030
f"{CWD}" f"/data_vimeo_{today.year}_{today.month}_{today.day}.csv"
3131
)

0 commit comments

Comments
 (0)