home
/
code
/
covid-19-scrapers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cfe8b55
)
Relocate path to a variable
author
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 17 Mar 2020 02:33:23 +0000
(22:33 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 17 Mar 2020 02:33:23 +0000
(22:33 -0400)
fetch-case-count-usa-ny
patch
|
blob
|
blame
|
history
diff --git
a/fetch-case-count-usa-ny
b/fetch-case-count-usa-ny
index
95a039f
..
b3bd251
100755
(executable)
--- a/
fetch-case-count-usa-ny
+++ b/
fetch-case-count-usa-ny
@@
-50,6
+50,10
@@
esac
curl 'https://health.ny.gov/diseases/communicable/coronavirus/' \
| hxpipe \
| awk -v location="$location" '
curl 'https://health.ny.gov/diseases/communicable/coronavirus/' \
| hxpipe \
| awk -v location="$location" '
+ BEGIN {
+ target_path = "/html/body/div/div/div/div/div/div/table/tr/td"
+ }
+
/^[\(\)]/ {
update_node()
next
/^[\(\)]/ {
update_node()
next
@@
-64,12
+68,12
@@
curl 'https://health.ny.gov/diseases/communicable/coronavirus/' \
XmlPayload = substr($0, 2, length($0))
}
XmlPayload = substr($0, 2, length($0))
}
- XmlPath ==
"/html/body/div/div/div/div/div/div/table/tr/td"
&& XmlPayload == location {
+ XmlPath ==
target_path
&& XmlPayload == location {
found = 1;
next
}
found = 1;
next
}
- XmlPath ==
"/html/body/div/div/div/div/div/div/table/tr/td"
&& found {
+ XmlPath ==
target_path
&& found {
print XmlPayload;
found = 0;
next;
print XmlPayload;
found = 0;
next;
This page took
0.021583 seconds
and
4
git commands to generate.