<commit_before>// ==UserScript==
// @match http://www.munzee.com/*
// @name         aMunzee
// @namespace    com.carlosefonseca.munzee
// @author       <NAME>
// @description  Turns the Munzee pages amazing
// @version		 0.1.2
// ==/UserScript==


// attaches the script to the body of the page allowing it to use the jQuery it already has
function addJQuery(callback) {
	var style = document.createElement("style");
	style.textContent = "#mapCanvas { width: 100% !important; } #map { position:absolute !important; height:100% !important; width:100% !important; left: 0 !important; top: 0 !important; z-index: 1000;}";
	document.body.appendChild(style);

    var script = document.createElement("script");
    script.textContent = "(" + callback.toString() + ")();";
    document.body.appendChild(script);
}


// the guts of this userscript
function main() {
	$("#logged-in-message").html($("#logged-in-message").html().replace(/back, (.+)\. | </,'<a href="http://www.munzee.com/m/$1" title="Your public profile page">$1</a> '))

	var map = $("#mapCanvas", "#body-box-content .content-box:first").detach();
	if (map.length == 0) return;
	var fulltxt = $("#body-box-content .content-box:first").text();
	$("#body-box-content .content-box:first").css("padding","20px").html($("<div id='details'></div>")).append(map);
	initialize();

	var obj = new Object();

	// Retrieves the notes
	notesSTR = "Notes: ";
	notesStart = fulltxt.indexOf(notesSTR);
	notesEnd = fulltxt.search(/\s*Deployed At:/);
	obj["Notes"] = fulltxt.slice(notesStart+notesSTR.length, notesEnd);
	obj["Notes"] = $.trim(obj["Notes"]).replace(/\n/g,"<br/>\n");

	txt = fulltxt.slice(0,notesStart)+fulltxt.slice(notesEnd);

	// split the rest of the text-data
	var patt=/\s*([^:]+): (.*)\s*/g;
	while (match = patt.exec(txt)) {
		obj[match[1]] = match[2];
	}

	// Title
	html = '<p id="mname" style="line-height:2em"><span style="font-size: 200%;font-weight:bold;margin-right:10px;color: #333;">'+obj['Friendly Name']+'</span> by '+obj['Creator']+'</p>';

	// Location
	if (obj["Deployed"]=="YES") {
		html += '<p style="color:#555;line-height:1.6em"><span>'+obj["DDD MM.MMM"]+'</span> &nbsp;•&nbsp; <span>'+obj["Decimal"]+'</span> <span style="margin-left:30px">'+obj['Location']+'</span></p>';
	}

	// Deploy & Dates
	if (obj["Deployed At"]!="") {
	  html += '<p style="color:#555;line-height:1.6em"><span id="mdate" style="width: 270px;display: inline-block;">Placed: '+obj['Deployed At']+'</span>		<span id="mfirst" style="margin-right:30px">First to Capture: <span style="font-weight:bold">'+obj['First To Capture']+'</span></span><br/>'+
		'<span style="width: 270px;display: inline-block;">Last Capture: '+obj["Last Captured At"]+'</span> <span style="margin-right:30px">Captured <span style="font-weight:bold">'+obj["Number of Captures"]+'</span> times</span></p>';
	}

	if (obj["Deployed"]=="NO") {
	  html += '<p style="color:#944;line-height:1.6em;font-weight:bold;">Not deployed</p>';
	}

	// Notes
	html += '<p style="line-height:1.4em;color:#222;margin:20px 0px;padding:10px 10px;background-color:#E7F0CE">'+obj["Notes"]+'</p>';

	$("#details").html(html);
}




// add the main function to the body of the page, and run it.
addJQuery(main);<commit_msg>added links for google maps and geocaching<commit_after>// ==UserScript==
// @match http://www.munzee.com/*
// @name         aMunzee
// @namespace    com.carlosefonseca.munzee
// @author       <NAME>
// @description  Turns the Munzee pages amazing
// @version		 0.1.3
// ==/UserScript==


// attaches the script to the body of the page allowing it to use the jQuery it already has
function addJQuery(callback) {
	var style = document.createElement("style");
	style.textContent = "#mapCanvas { width: 100% !important; } #map { position:absolute !important; height:100% !important; width:100% !important; left: 0 !important; top: 0 !important; z-index: 1000;}";
	document.body.appendChild(style);

    var script = document.createElement("script");
    script.textContent = "(" + callback.toString() + ")();";
    document.body.appendChild(script);
}


// the guts of this userscript
function main() {
	$("#logged-in-message").html($("#logged-in-message").html().replace(/back, (.+)\. | </,'<a href="http://www.munzee.com/m/$1" title="Your public profile page">$1</a> '))

	var map = $("#mapCanvas", "#body-box-content .content-box:first").detach();
	if (map.length == 0) return;
	var fulltxt = $("#body-box-content .content-box:first").text();
	$("#body-box-content .content-box:first").css("padding","20px").html($("<div id='details'></div>")).append(map);
	initialize();

	var obj = new Object();

	// Retrieves the notes
	notesSTR = "Notes: ";
	notesStart = fulltxt.indexOf(notesSTR);
	notesEnd = fulltxt.search(/\s*Deployed At:/);
	obj["Notes"] = fulltxt.slice(notesStart+notesSTR.length, notesEnd);
	obj["Notes"] = $.trim(obj["Notes"]).replace(/\n/g,"<br/>\n");

	txt = fulltxt.slice(0,notesStart)+fulltxt.slice(notesEnd);

	// split the rest of the text-data
	var patt=/\s*([^:]+): (.*)\s*/g;
	while (match = patt.exec(txt)) {
		obj[match[1]] = match[2];
	}

	// Title
	html = '<p id="mname" style="line-height:2em"><span style="font-size: 200%;font-weight:bold;margin-right:10px;color: #333;">'+obj['Friendly Name']+'</span> by '+obj['Creator']+'</p>';

	// Location
	if (obj["Deployed"]=="YES") {
		html += '<p style="color:#555;line-height:1.6em"><span>'+obj["DDD MM.MMM"]+'</span> &nbsp;•&nbsp; <span>'+obj["Decimal"]+'</span> <span style="margin-left:30px">'+obj['Location']+'</span></p>';
	}

	// Deploy & Dates
	if (obj["Deployed At"]!="") {
	  html += '<p style="color:#555;line-height:1.6em"><span id="mdate" style="width: 270px;display: inline-block;">Placed: '+obj['Deployed At']+'</span>		<span id="mfirst" style="margin-right:30px">First to Capture: <span style="font-weight:bold">'+obj['First To Capture']+'</span></span><br/>'+
		'<span style="width: 270px;display: inline-block;">Last Capture: '+obj["Last Captured At"]+'</span> <span style="margin-right:30px">Captured <span style="font-weight:bold">'+obj["Number of Captures"]+'</span> times</span></p>';
	}

	if (obj["Deployed"]=="NO") {
	  html += '<p style="color:#944;line-height:1.6em;font-weight:bold;">Not deployed</p>';
	}

	// Notes
	html += '<p style="line-height:1.4em;color:#222;margin:20px 0px;padding:10px 10px;background-color:#E7F0CE">'+obj["Notes"]+'</p>';

	// Links
	var coord = obj["Decimal"].split(" / ");
	console.log(coord);
	html += '<div style="position:absolute;top:0;right:0;text-align:right"><a href="http://maps.google.com/maps?q='+coord[0]+','coord[1]'">Google Maps</a><br/><a href="http://www.geocaching.com/map/beta/default.aspx?lat='+coord[0]+'&lng='+coord[1]+'&z=16">Geocaches</a></div>';
	console.log('<div style="position:absolute;top:0;right:0;text-align:right"><a href="http://maps.google.com/maps?q='+coord[0]+','coord[1]'">Google Maps</a><br/><a href="http://www.geocaching.com/map/beta/default.aspx?lat='+coord[0]+'&lng='+coord[1]+'&z=16">Geocaches</a></div>');
	$("#details").html(html);
}




// add the main function to the body of the page, and run it.
addJQuery(main);
{'fraction_non_alphanumeric': 0.24237740621048195, 'fraction_numerical': 0.02360545173528172, 'mean_word_length': 5.205754141238012, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '2796384', 'n_tokens_mistral': 2719, 'n_tokens_neox': 2567, 'n_words': 465}