Update NY path
[covid-19-scrapers.git] / fetch-case-count-usa-ny
index 95a039f..4c363ee 100755 (executable)
@@ -50,6 +50,14 @@ esac
 curl 'https://health.ny.gov/diseases/communicable/coronavirus/' \
 | hxpipe \
 | awk -v location="$location" '
+    BEGIN {
+        # 2020-03-16 morning-afternoon
+        #target_path = "/html/body/div/div/div/div/div/div/table/tr/td"
+
+        # 2020-03-16 late evening 22:30
+        target_path = "/html/body/div/div/div/div/div/div/tr/td"
+    }
+
     /^[\(\)]/ {
         update_node()
         next
@@ -64,12 +72,12 @@ curl 'https://health.ny.gov/diseases/communicable/coronavirus/' \
         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
     }
 
-    XmlPath == "/html/body/div/div/div/div/div/div/table/tr/td" && found {
+    XmlPath == target_path && found {
         print XmlPayload;
         found = 0;
         next;
This page took 0.021006 seconds and 4 git commands to generate.