aboutsummaryrefslogtreecommitdiffstats
path: root/har2kml
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2017-01-14 17:07:55 +0100
committerPetter Reinholdtsen <pere@hungry.com>2017-01-14 17:07:55 +0100
commitb2b53a467e720cbf1f09c0dedc81afbed5389178 (patch)
treeb666955953dbf99b8cb67a755efd2b50c83ef631 /har2kml
parenta764764fab97b67f345817d0794aed310c25d902 (diff)
Change har2kml to only check HTTP URLs and keep a cache of kml traces.
Diffstat (limited to 'har2kml')
-rwxr-xr-xhar2kml10
1 files changed, 7 insertions, 3 deletions
diff --git a/har2kml b/har2kml
index b95cd02..5c3c5f2 100755
--- a/har2kml
+++ b/har2kml
@@ -10,13 +10,17 @@ else
fi
har2hosts() {
- jq -r '.log | .entries | map(.request) | map(.url) | join("\n")' < $har |
+ jq -r '.log | .entries | map(.request) | map(.url) | join("\n")' < $har | grep ^http |
cut -d/ -f3 | sort -u
}
+if [ ! -d cache ] ; then mkdir cache ; fi
+
for h in $(har2hosts) ; do
- kml="$h.kml"
- curl -s "https://www.geotraceroute.com/petter.php?host=$h" > "$kml"
+ kml="cache/$h.kml"
+ if [ ! -f "$kml" ] ; then
+ curl -s "https://www.geotraceroute.com/petter.php?host=$h" > "$kml"
+ fi
kmls="$kmls $kml"
done