mirror of
https://github.com/unitedstates/congress-legislators.git
synced 2025-12-19 09:50:37 -05:00
repoint cspan update url
This commit is contained in:
@@ -9,9 +9,9 @@ def run():
|
||||
# load in current members
|
||||
y = load_data("legislators-current.yaml")
|
||||
for m in y:
|
||||
# retrieve C-SPAN id, if available, from NYT API
|
||||
# retrieve C-SPAN id, if available, from ProPublica API
|
||||
# TODO: use utils.download here
|
||||
response = urllib.request.urlopen("http://politics.nytimes.com/congress/svc/politics/v3/us/legislative/congress/members/%s.json" % m['id']['bioguide']).read()
|
||||
response = urllib.request.urlopen("https://projects.propublica.org/represent/api/v1/members/%s.json" % m['id']['bioguide']).read()
|
||||
j = json.loads(response.decode("utf8"))
|
||||
cspan = j['results'][0]['cspan_id']
|
||||
if not cspan == '':
|
||||
@@ -19,4 +19,4 @@ def run():
|
||||
save_data(y, "legislators-current.yaml")
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
run()
|
||||
|
||||
Reference in New Issue
Block a user