diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2017-01-14 18:32:03 +0100 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2017-01-14 18:32:03 +0100 |
commit | a4fd979196dee88e6b02f1ce5bf4cbfc44874672 (patch) | |
tree | 5d7536848863c64bf02156d1d121a7d5a51f060c | |
parent | 262e119be71406ef5916ccdb05b47a675e1f48d0 (diff) |
Cleanup.
-rwxr-xr-x | har2kml | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -3,10 +3,19 @@ # Use geotraceroute to fetch traceroutes to all hosts used to view a web page and print KML # output for all traces. +usage() { + cat <<EOF +Usage: $0 <har-file> +EOF +} + +gtrnode=4 + if [ "$1" ]; then har="$1" else - har=har-data/https\:%%www.politi.no.har + usage + exit 1 fi har2hosts() { @@ -19,7 +28,7 @@ if [ ! -d cache ] ; then mkdir cache ; fi for h in $(har2hosts) ; do kml="cache/$h.kml" if [ ! -f "$kml" ] ; then - curl -s "https://www.geotraceroute.com/petter.php?host=$h" > "$kml" + curl -s "https://www.geotraceroute.com/petter.php?node=$gtrnode&host=$h" > "$kml" fi kmls="$kmls $kml" done |