<commit_before><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>WeeFree</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css"/>
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<style>
    #map {height: 480px;}
	.wifree {background-image: url('/static/WeFree3.svg'); height: 16px; width: 25px;}
</style>
<script>
 $(function() {
	markers = {};
    decode = function(encoded) {
        encripted  = atob(encoded.trim());
        answer = "";
        l = encripted.length
        key = encripted.slice(0, -3);
        data = encripted.slice(3);
        key = [key.charCodeAt(0), key.charCodeAt(1), key.charCodeAt(2)];
        for (var i in data){
            answer += String.fromCharCode(data.charCodeAt(i) ^ key[i % 3]);
        }
        return answer;
    }
    get_nearby = function(lat, lon) {
        base_url = 'http://www.zonagratis.com.br/api/';
        nearby_url = 'get/hotspot/nearby?lat='+lat+'&lon='+lon;
        $.get(base_url+nearby_url, function(data){
            hotspots = data["hotspots"]
            for (var prop in hotspots) {
                var hotspot = hotspots[prop];
                if (hotspot["open"] === false) {
                    password =  decode(hotspot["password"]);
                    $.ajax({type: "POST", url: /report/,
                    data: JSON.stringify({
                        "bssid": hotspot["mac"],
                        "essid": hotspot["ssid"],
                        "lat": hotspot["lat"],
                        "long": hotspot["lon"],
                        "password": password,
                        "success": true,
                    }), dataType: "json",
                        contentType: "application/json",
                    });
                    hash = hotspot["lat"].toString() + hotspot["lon"].toString() + hotspot["ssid"].toString() + hotspot["password"].toString()
                    if (!markers[hash]) {
                        markers[hash] = L.marker([hotspot["lat"], hotspot["lon"]],{icon: icon})
                            .addTo(map).bindPopup(hotspot["ssid"] + "<br/>" + password);
                    } else {
                        console.log(hash + " exits!")
                    }
                }
            }
        });
    };

    $("#id_crawl_button").click(function (asd) {
        lat = $("#id_lat").val();
        lon = $("#id_long").val();
        get_nearby(lat, lon);
    });
    $("#id_auto_crawl_button").click(function (asd) {
		radius_max = 1;
        lat = $("#id_lat").val();
        lon = $("#id_long").val();
        meters = 100.0;
        radius = 0.1;
        degree = 0.0;
        radius_inc = 10.0 / 360.0;
        while (radius < radius_max) {
			window.setTimeout(function(){},1000);
			console.log(lat+Math.sin(degree)*radius + " " + lon+Math.cos(degree)*radius);
			/*get_nearby(lat+Math.sin(degree)*radius, lon+Math.cos(degree)*radius);*/
            degree_inc = 360.0 * radius_inc/radius;
            radius += radius_inc;
            degree += degree_inc;
            degree %= 360.0;
            if (degree < 0.01) {
                radius = 0.1;
                lon = Math.random(-180.0,180.0);
                lat = Math.floor(-90.0,90.0);
			}
		}
    });
	
    lat = 0;
    lon = 0;
    // create a map in the "map" div, set the view to a given place and zoom
	icon = L.divIcon({className: 'wifree', iconSize: [25, 16] });
    map = L.map('map').setView([lat, lon], 3);

    // add an OpenStreetMap tile layer
    L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
        attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
    }).addTo(map);

    map.on('click', function (e) {
        console.log(e.latlng.lat);
        console.log(e.latlng.lng);
        $("#id_lat").val(e.latlng.lat);
        $("#id_long").val(e.latlng.lng);
    });
});

</script>
</head>
<body>
    WeeFree Crawl

    <li><label for="id_lat">Lat:</label> <input id="id_lat" name="lat" type="text" /></li>
    <li><label for="id_long">Long:</label> <input id="id_long" name="long" type="text" /></li>
    <li><label for="id_crawl_button">Crawl:</label><input id="id_crawl_button" type="button" value="crawl!"/><input id="id_auto_crawl_button" type="button" value="auto crawl!"/></li>

    <div id="map"></div>
</body>
</html><commit_msg>Update auto crawl.<commit_after><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>WeeFree</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css"/>
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<style>
    #map {height: 480px;}
    .wifree {background-image: url('/static/WeFree3.svg'); height: 16px; width: 25px;}
</style>
<script>
 $(function() {
    markers = {};
    decode = function(encoded) {
        encripted  = atob(encoded.trim());
        answer = "";
        l = encripted.length
        key = encripted.slice(0, -3);
        data = encripted.slice(3);
        key = [key.charCodeAt(0), key.charCodeAt(1), key.charCodeAt(2)];
        for (var i in data){
            answer += String.fromCharCode(data.charCodeAt(i) ^ key[i % 3]);
        }
        return answer;
    }
    get_nearby = function(lat, lon) {
        base_url = 'http://www.zonagratis.com.br/api/';
        nearby_url = 'get/hotspot/nearby?lat='+lat+'&lon='+lon;
        $.get(base_url+nearby_url, function(data){
            hotspots = data["hotspots"]
            for (var prop in hotspots) {
                var hotspot = hotspots[prop];
                if (hotspot["open"] === false) {
                    password =  decode(hotspot["password"]);
                    $.ajax({type: "POST", url: /report/,
                    data: JSON.stringify({
                        "bssid": hotspot["mac"],
                        "essid": hotspot["ssid"],
                        "lat": hotspot["lat"],
                        "long": hotspot["lon"],
                        "password": password,
                        "success": true,
                    }), dataType: "json",
                        contentType: "application/json",
                    });
                    hash = hotspot["lat"].toString() + hotspot["lon"].toString() + hotspot["ssid"].toString() + hotspot["password"].toString()
                    if (!markers[hash]) {
                        markers[hash] = L.marker([hotspot["lat"], hotspot["lon"]],{icon: icon})
                            .addTo(map).bindPopup(hotspot["ssid"] + "<br/>" + password);
                    } else {
                        console.log(hash + " exists!")
                    }
                }
            }
        });
    };

    $("#id_crawl_button").click(function (asd) {
        lat = $("#id_lat").val();
        lon = $("#id_long").val();
        get_nearby(lat, lon);
    });
    $("#id_auto_crawl_button").click(function (asd) {
        radius_max = 1;
        lat = parseFloat($("#id_lat").val());
        lon = parseFloat($("#id_long").val());
        radius = 0.1;
        degree = 0.0;
        radius_inc = 10.0 / 360.0;
        while (radius < radius_max) {
            get_nearby( lat+(Math.sin(degree)*radius), lon+(Math.cos(degree)*radius) );
            degree_inc = radius_inc/radius;
            radius += radius_inc;
            degree += degree_inc;
            degree %= 360.0;
            if (degree_inc < 0.01) {
                radius = 0.1;
                lon = Math.random(-180.0,180.0);
                lat = Math.floor(-90.0,90.0);
            }
        }
		console.log("Finished auto crawling!")
    });
    
    lat = 0;
    lon = 0;
    // create a map in the "map" div, set the view to a given place and zoom
    icon = L.divIcon({className: 'wifree', iconSize: [25, 16] });
    map = L.map('map').setView([lat, lon], 3);

    // add an OpenStreetMap tile layer
    L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
        attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
    }).addTo(map);

    map.on('click', function (e) {
        console.log(e.latlng.lat);
        console.log(e.latlng.lng);
        $("#id_lat").val(e.latlng.lat);
        $("#id_long").val(e.latlng.lng);
    });
});

</script>
</head>
<body>
    WeeFree Crawl

    <li><label for="id_lat">Lat:</label> <input id="id_lat" name="lat" type="text" /></li>
    <li><label for="id_long">Long:</label> <input id="id_long" name="long" type="text" /></li>
    <li><label for="id_crawl_button">Crawl:</label><input id="id_crawl_button" type="button" value="crawl!"/><input id="id_auto_crawl_button" type="button" value="auto crawl!"/></li>

    <div id="map"></div>
</body>
</html>
{'fraction_non_alphanumeric': 0.1904492474821772, 'fraction_numerical': 0.0167477650786466, 'mean_word_length': 1.9777628032345014, 'pattern_counts': {'":': 12, '<': 87, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3011319', 'n_tokens_mistral': 3065, 'n_tokens_neox': 2870, 'n_words': 501}