updating data
This commit is contained in:
@@ -163,7 +163,7 @@
|
||||
</label>
|
||||
<h2 class="heading"></h2>
|
||||
<p>
|
||||
<b>Check out your batch code</b> (Last updated: <span id="last_updated">March 11, 2022</span>)
|
||||
<b>Check out your batch code</b> (Last updated: <span id="last_updated">March 18, 2022</span>)
|
||||
</p>
|
||||
<p>
|
||||
<table class="display" id="batchCodeTable">
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -27,33 +27,33 @@
|
||||
"from dateutil.parser import parse\n",
|
||||
"\n",
|
||||
"def needsUpdate():\n",
|
||||
" lastUpdatedBatchCodeTable = _getLastUpdatedBatchCodeTable()\n",
|
||||
" print('lastUpdatedBatchCodeTable:', lastUpdatedBatchCodeTable)\n",
|
||||
" lastUpdated = _getLastUpdated()\n",
|
||||
" print(' lastUpdated:', lastUpdated)\n",
|
||||
"\n",
|
||||
" lastUpdatedOriginal = _getLastUpdatedOriginal()\n",
|
||||
" print('lastUpdatedOriginal:', lastUpdatedOriginal)\n",
|
||||
" lastUpdatedDataSource = _getLastUpdatedDataSource()\n",
|
||||
" print('lastUpdatedDataSource:', lastUpdatedDataSource)\n",
|
||||
"\n",
|
||||
" return lastUpdatedBatchCodeTable < lastUpdatedOriginal\n",
|
||||
" return lastUpdated < lastUpdatedDataSource\n",
|
||||
" \n",
|
||||
"def _getLastUpdatedBatchCodeTable():\n",
|
||||
" return _getLastUpdated(\n",
|
||||
"def _getLastUpdated():\n",
|
||||
" return __getLastUpdated(\n",
|
||||
" url = \"https://knollfrank.github.io/HowBadIsMyBatch/batchCodeTable.html\",\n",
|
||||
" getDateStr = lambda soup: soup.find(id = \"last_updated\").text)\n",
|
||||
"\n",
|
||||
"def _getLastUpdatedOriginal():\n",
|
||||
"def _getLastUpdatedDataSource():\n",
|
||||
" def getDateStr(soup):\n",
|
||||
" lastUpdated = soup.find(string = re.compile(\"Last updated\"))\n",
|
||||
" return re.search('Last updated: (.+).', lastUpdated).group(1)\n",
|
||||
"\n",
|
||||
" return _getLastUpdated(url = \"https://vaers.hhs.gov/data/datasets.html\", getDateStr = getDateStr)\n",
|
||||
" return __getLastUpdated(url = \"https://vaers.hhs.gov/data/datasets.html\", getDateStr = getDateStr)\n",
|
||||
"\n",
|
||||
"def _getLastUpdated(url, getDateStr):\n",
|
||||
"def __getLastUpdated(url, getDateStr):\n",
|
||||
" htmlContent = requests.get(url).text\n",
|
||||
" soup = BeautifulSoup(htmlContent, \"lxml\")\n",
|
||||
" dateStr = getDateStr(soup)\n",
|
||||
" return parse(dateStr).date()\n",
|
||||
"\n",
|
||||
"print('needsUpdate: ', needsUpdate())"
|
||||
"print('needsUpdate:', needsUpdate())"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -766,6 +766,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# FK-TODO: analog zu Intensivstationen.ipynb einen KreisOptionsSetter einsetzen zum automatischen Speichern der Options in der html-Datei\n",
|
||||
"def printCountryOptions(countries):\n",
|
||||
" for country in countries:\n",
|
||||
" printCountryOption(country)\n",
|
||||
@@ -805,6 +806,14 @@
|
||||
" country = 'Global',\n",
|
||||
" minADRsForLethality = minADRsForLethality)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "9c70f2db",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
Reference in New Issue
Block a user