aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2017-01-14 18:32:03 +0100
committerPetter Reinholdtsen <pere@hungry.com>2017-01-14 18:32:03 +0100
commita4fd979196dee88e6b02f1ce5bf4cbfc44874672 (patch)
tree5d7536848863c64bf02156d1d121a7d5a51f060c
parent262e119be71406ef5916ccdb05b47a675e1f48d0 (diff)
Cleanup.
-rwxr-xr-xhar2kml13
1 files changed, 11 insertions, 2 deletions
diff --git a/har2kml b/har2kml
index 5c3c5f2..174a1e8 100755
--- a/har2kml
+++ b/har2kml
@@ -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