Skip to content

Commit 39772f2

Browse files
authored
Merge pull request #1210 from resource-watch/cit_002
update to https
2 parents fa00019 + 4ef34d2 commit 39772f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

upload_worldbank_data/contents/src/update_worldbank_data_on_carto.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def fetch_wb_data(table):
135135
try:
136136
# fetch data for this indicator (only the first 10,000 entries will be returned)
137137
res = requests.get(
138-
"http://api.worldbank.org/v2/countries/all/indicators/{}?format=json&per_page=10000".format(indicator))
138+
"https://api.worldbank.org/v2/countries/all/indicators/{}?format=json&per_page=10000".format(indicator))
139139
# check how many pages of data there are for this indicator
140140
pages = int(res.json()[0]['pages'])
141141
break
@@ -151,7 +151,7 @@ def fetch_wb_data(table):
151151
while try_num <= 5:
152152
try:
153153
res = requests.get(
154-
"http://api.worldbank.org/v2/countries/all/indicators/{}?format=json&per_page=10000&page={}".format(
154+
"https://api.worldbank.org/v2/countries/all/indicators/{}?format=json&per_page=10000&page={}".format(
155155
indicator, page + 1))
156156
json = json + res.json()[1]
157157
break
@@ -269,7 +269,7 @@ def main():
269269
# pull the CSVs for each indicator
270270
for indicator in indicators:
271271
# insert the url used to download the data from the source website
272-
url = f'http://api.worldbank.org/v2/en/indicator/{indicator}?downloadformat=csv'
272+
url = f'https://api.worldbank.org/v2/en/indicator/{indicator}?downloadformat=csv'
273273
# download the data from the source
274274
raw_data_file = os.path.join(data_dir, f'{indicator}_DS2_en_csv_v2')
275275
urllib.request.urlretrieve(url, raw_data_file)

0 commit comments

Comments
 (0)