Skip to content

Commit 734dca9

Browse files
committed
initial switch to new API endpoint; doesn't account for format change
1 parent 01365a1 commit 734dca9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/acquisition/flusurv/flusurv.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,15 @@ def fetch_json(path, payload, call_count=1, requests_impl=requests):
123123
def fetch_flusurv_object(location_code):
124124
"""Return decoded FluSurv JSON object for the given location."""
125125
return fetch_json(
126-
"PostPhase03GetData",
126+
"PostPhase03DataTool",
127127
{
128128
"appversion": "Public",
129-
"networkid": location_code[0],
130-
"cacthmentid": location_code[1],
129+
"key": "",
130+
"injson": [
131+
"networkid": location_code[0],
132+
"cacthmentid": location_code[1]
133+
# Also need `seasonid` here?
134+
],
131135
},
132136
)
133137

@@ -210,7 +214,10 @@ def get_current_issue():
210214
"""Scrape the current issue from the FluSurv main page."""
211215

212216
# fetch
213-
data = fetch_json("GetPhase03InitApp?appVersion=Public", None)
217+
data = fetch_json(
218+
"PostPhase03DataTool",
219+
{"appversion": "Public", "key": "", "injson": []}
220+
)
214221

215222
# extract
216223
date = datetime.strptime(data["loaddatetime"], "%b %d, %Y")

0 commit comments

Comments
 (0)