FilesSubmittedBranchesLabelsClientsUsersJobsHelp
Tree viewShow file textShow revision historyShow/hide recent activityInformation
Recent activity in //depot/projects/wardrive-map/kismet2xml.pl/...
1312005/03/19packetratgreen pin = open, red pin = WEP. there are a LOT of green pins in kitsilano.
1242005/02/09mtxmaps.google.com launched yesterday so obviously we need our war-driving logs on it.
//depot/projects/wardrive-map/kismet2xml.pl#2

//depot/projects/wardrive-map/kismet2xml.pl#2 – edit change 131 (xtext) ·revision history

1#!/usr/bin/perl
2# kismet2xml.pl - squash Kismet's network logs into a little XML file
3# that map.html can slurp with XMLHttpRequest.
4#
5# usage: kismet2xml.pl Kismet-Feb-08-2005-1.xml [...] > nets.xml
6#
7# mtx, feb 2005. the day after maps.google.com launched. priorities.
8
9use strict;
10use XML::Simple;
11
12my %nets;
13for my $file (@ARGV) {
14 my $k = XMLin($file, ForceArray => ['wireless-network'], KeyAttr => []);
15 for my $n (@{ $k->{'wireless-network'} || [] }) {
16 my $gps = $n->{'gps-info'} or next;
17 my $bssid = $n->{BSSID};
18 my $lat = ($gps->{'min-lat'} + $gps->{'max-lat'}) / 2;
19 my $lon = ($gps->{'min-lon'} + $gps->{'max-lon'}) / 2;
20 next unless $lat && $lon;
21 $nets{$bssid} = {
22 ssid => ref $n->{SSID} ? '' : $n->{SSID},
23 lat => $lat,
24 lon => $lon,
25 chan => $n->{channel},
26 wep => ($n->{wep} && $n->{wep} eq 'true') ? 1 : 0,
27 };
28 }
29}
30
31print qq{<?xml version="1.0"?>\n<nets>\n};
32for my $b (sort keys %nets) {
33 my $n = $nets{$b};
34 my $ssid = $n->{ssid};
35 $ssid =~ s/&/&amp;/g;
36 $ssid =~ s/</&lt;/g;
37 $ssid =~ s/"/&quot;/g;
38 printf qq{ <net bssid="%s" ssid="%s" lat="%.6f" lng="%.6f" chan="%s" wep="%d"/>\n},
39 $b, $ssid, $n->{lat}, $n->{lon}, $n->{chan}, $n->{wep};
40}
41print "</nets>\n";

P4Web/LINUX26X86/2005.1/82295 · Copyright © 1995-2005 Perforce Software · ttul.org