86 lines
2 KiB
Text
86 lines
2 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "4278b2ab",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import os"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "a7940b73",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"with open('curl', 'r') as f:\n",
|
|
" curl = f.read()[:-1]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"def test(locator, eln):\n",
|
|
" # print(curl.format(locator, eln.replace('%', '%25')))\n",
|
|
" ret = os.system(curl.format(locator, eln.replace('%', '%25')) + ' | grep LADUE > /dev/null')\n",
|
|
" return ret == 0"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "c27d1a2f",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"for i in range(0, 6):\n",
|
|
" with open(str(i) + '.html') as f:\n",
|
|
" r = f.read()\n",
|
|
" pos = 0\n",
|
|
" cnt = 0\n",
|
|
" while (x := r.find('return ShowParcelData(', pos)) != -1:\n",
|
|
" pos = x + 1\n",
|
|
" cnt += 1\n",
|
|
" if cnt % 3 != 0:\n",
|
|
" continue\n",
|
|
" m = r.find(' ', x + 23)\n",
|
|
" locator = r[x + 23:m - 2]\n",
|
|
" eln = r[m + 2:r.find(')', x) - 1]\n",
|
|
" if test(locator, eln):\n",
|
|
" name = r[r.find(')', x) + 4:r.find('<', x)]\n",
|
|
" print(locator, eln, name)"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"interpreter": {
|
|
"hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a"
|
|
},
|
|
"kernelspec": {
|
|
"display_name": "C++11",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.9.9"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|