aboutsummaryrefslogtreecommitdiffstats
path: root/har2kml
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2017-01-14 18:33:35 +0100
committerPetter Reinholdtsen <pere@hungry.com>2017-01-14 18:33:35 +0100
commit473fb4add901dad27a9907ad8a3f7bae0d33b319 (patch)
tree6d377f5e84d12d2ef581ed1595bd92239476574c /har2kml
parenta4fd979196dee88e6b02f1ce5bf4cbfc44874672 (diff)
Cleanup.
Diffstat (limited to 'har2kml')
-rwxr-xr-xhar2kml8
1 files changed, 6 insertions, 2 deletions
diff --git a/har2kml b/har2kml
index 174a1e8..614d84a 100755
--- a/har2kml
+++ b/har2kml
@@ -23,6 +23,11 @@ har2hosts() {
cut -d/ -f3 | sort -u
}
+kmljoin() {
+ cat $* | perl -e '$line = ""; while (<>) { $line .= $_; }; $line =~ s%</Document>\s</kml>\s<\?xml version="1.0" encoding="UTF-8"\?>\s<kml xmlns="http://www.opengis.net/kml/2.2">\s<Document>\s<Info>Generated by https://geotraceroute.com</Info>%%gs; $line =~ s%<name>.+</name>%%g; print $line;'
+
+}
+
if [ ! -d cache ] ; then mkdir cache ; fi
for h in $(har2hosts) ; do
@@ -32,5 +37,4 @@ for h in $(har2hosts) ; do
fi
kmls="$kmls $kml"
done
-
-cat $kmls | perl -e '$line = ""; while (<>) { $line .= $_; }; $line =~ s%</Document>\s</kml>\s<\?xml version="1.0" encoding="UTF-8"\?>\s<kml xmlns="http://www.opengis.net/kml/2.2">\s<Document>\s<Info>Generated by https://geotraceroute.com</Info>%%gs; $line =~ s%<name>.+</name>%%g; print $line;'
+kmljoin $kmls