diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2017-01-14 17:07:55 +0100 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2017-01-14 17:07:55 +0100 |
commit | b2b53a467e720cbf1f09c0dedc81afbed5389178 (patch) | |
tree | b666955953dbf99b8cb67a755efd2b50c83ef631 /har2kml | |
parent | a764764fab97b67f345817d0794aed310c25d902 (diff) |
Change har2kml to only check HTTP URLs and keep a cache of kml traces.
Diffstat (limited to 'har2kml')
-rwxr-xr-x | har2kml | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 |