Skip to content

Commit e19f6e8

Browse files
authored
Merge pull request #1805 from jepler/fix-covid-tracker
Fix parsing the vaccination data
2 parents 14c9eb8 + dcd5f0d commit e19f6e8

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

MagTag_Covid_Vaccination/code.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
value = magtag.fetch().split("\n")[-2].split(",")
5959
print("Response is", value)
6060

61-
vaccinated = int(value[-2]) / 331984513
62-
fully_vaccinated = int(value[-1]) / 331984513
61+
vaccinated = int(value[7]) / 331984513
62+
fully_vaccinated = int(value[8]) / 331984513
6363

6464
magtag.set_text(f"{value[0]} Vaccination Rates", 0, False)
6565
magtag.set_text(value[1], 1, False)
@@ -74,8 +74,11 @@
7474
magtag.refresh()
7575

7676
seconds_to_sleep = 24 * 60 * 60 # Sleep for one day
77-
print(f"Sleeping for {seconds_to_sleep} seconds")
78-
magtag.exit_and_deep_sleep(seconds_to_sleep)
7977

8078
except (ValueError, RuntimeError) as e:
81-
print("Some error occured, retrying! -", e)
79+
print("Some error occured, retrying in one hour! -", e)
80+
seconds_to_sleep = 60 * 60 # Sleep for one hour
81+
82+
print(f"Sleeping for {seconds_to_sleep} seconds")
83+
magtag.exit_and_deep_sleep(seconds_to_sleep)
84+

0 commit comments

Comments
 (0)