/*
Geocaching.com modified - 0.50 14/07/2005
Copyright (c) 2008, Thomas Holz, geocaching.itsth.de
This script modifies the geocaching.com page to make it better.
Pimp my Geocaching.com.2
Tag: User-Javascript, Greasemonkey, Geocaching.com, Opera, Firefox
*/
// ==UserScript==
// @name Pimp my Geocaching.com.2
// @namespace http://geocaching.itsth.de
// @include http://www.geocaching.com/seek/cache_details.aspx*
// ==/UserScript==
(function() {
function isfirefox()
{
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) return(true);
return(false);
}
function adjustbrowser(tag)
{
if (isfirefox())
{
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("
");
tag=tag.replace("", "
");
tag=tag.replace("", "");
tag=tag.replace("", "");
tag=tag.replace("
", "
");
tag=tag.replace("type=\"submit\" ", "");
}
return (tag);
}
function MyRemove(string, tag1)
{
tag1 = adjustbrowser(tag1);
pos1 = string.indexOf(tag1, 0);
if (pos1!=-1)
{
string = string.substr(0,pos1) + string.substr(pos1+tag1.length);
}
return (string);
}
//Removes tag1, tag2 and everything in between
function MyReplace(string, tag1, tag2)
{
tag1 = adjustbrowser(tag1);
tag2 = adjustbrowser(tag2);
pos1 = string.indexOf(tag1, 0);
if (pos1!=-1)
{
pos2 = string.indexOf(tag2, pos1);
if (pos2!=-1)
{
string = string.substr(0,pos1) + string.substr(pos2+tag2.length);
}
}
return (string);
}
function MyReplaceWithBetween(string, tag1, tag2, replacewith)
{
tag1 = adjustbrowser(tag1);
tag2 = adjustbrowser(tag2);
pos1 = string.indexOf(tag1, 0);
//alert(tag1+"=>".pos1);
if (pos1!=-1)
{
pos2 = string.indexOf(tag2, pos1);
if (pos2!=-1)
{
string = string.substr(0,pos1) + replacewith + string.substr(pos2+tag2.length);
}
}
return (string);
}
function MyReplaceWith(string, tag1, replacewith)
{
pos1 = string.indexOf(tag1, 0);
if (pos1!=-1)
{
string = string.substr(0,pos1) + replacewith + string.substr(pos1+tag1.length);
}
return (string);
}
function MyExtract(string, tag1, tag2)
{
tag1 = adjustbrowser(tag1);
tag2 = adjustbrowser(tag2);
pos1 = string.indexOf(tag1, 0);
if (pos1!=-1)
{
pos2 = string.indexOf(tag2, pos1);
if (pos2!=-1)
{
return (string.substr(pos1+tag1.length, pos2-pos1-tag1.length));
}
}
return ("");
}
var textpos = new Array("place is nice", "found the cache easily", "found the cache", "besten Cache", "wundervoll", "beatiful place", "a quick search", "this great place", "Found easily", "Tolle Gegend", "schnell gefunden", "echt phantastisch", "quick found", "are amazing", "hat uns sehr gut gefallen", "Fantastisch", "Nach kurzer Suche", "very nice spot", "bald gefunden", "Fascinating place", "Found it easily", "nice place", "schoener Ort", "beautiful place", "Super Location", "nice spot", "very much for showing", "great place", "after a short time", "wonderful place", "Koordinaten waren aber ok", "nice location", "one the best caches", "really impressing", "beatiful location", "enjoyed the place", "quickly discovered", "Nice place", "immer wieder schoen", "bizarre spot", "muy bonita", "Cool place", "Schoener Platz", "We enjoyed this cache", "Beautiful spot", "Highlight", "without any problems", "Wunderschoene Stelle", "Easy to find", "easy to find", "good coordinates", "amazing place", "took lots of pictures", "toller Platz", "after a short search", "thank you very much", "great cache", "beautiful surrounding", "spectacular place", "perfect coordinates", "Easy find", "saw the cache easily", "Found it quickly", "sofort gefunden", "schoene Aussicht", "nette Wanderung", "Found it quickly", "exact coordinates", "Interesting walk", "nice walk", "spactacular view", "nice cache", "great hiding place", "lovely walk", "Quick and easy found", "Nice walk", "nice cach�", "Great views", "after a short while", "schoene kleine Wanderung", "traumhaften Umgebung", "extraordinary place", "less than one hour", "very easy", "Great find", "very nice and beautiful", "unforgettable", "cache was great", "view is fantastic", "We enjoyed the", "special location", "Tolle Location", "beautiful way", "found it easy", "Nicer walk than", "without problems", "sehr schoener Cache", "DANKE", "quick find", "interesting area", "Fast to find", "Thanks for showing us", "beautiful views", "one of the nicest", "Incredible views", "Incredible view", "Thanks!!", "Beautiful village", "Found the cache", "Quick & easy found", "marvellous", "splendid view", "found it very fast", "beeindruckende Gegend", "easily found", "easily located", "Interesting place", "great view", "Nice spot", "Easy hike", "sehr schoene Runde", "schoene Runde", "absolut super", "exakte Koordinaten", "kaum Abweichungen", "problemlosen Fund", "Schoene Idee", "ratzfatz gefunden", "schoen versteckter", "schneller Fund", "nette Runde", "Knallercache", "einfallsreichen Stationen", "sensationelle Stationen", "wunderschoene Runde", "liebevoll gestaltete", "schoene Tour", "schoener Umgebung", "gut loesbar", "Blitzfund", "Schoene Gegend", "Prima Versteck", "Danke fuers zeigen", "Spass gemacht", "Tolle Runde", "supertolles Versteck", "trickreiche Versteck", "gut gefunden", "fix entdeckt", "nette cachelocation", "Interessante Lokation", "schoenes Versteck", "Nettes Versteck", "Schnell gefunden", "netten Cache", "direkt gefunden", "Easy Fund", "Gut gefunden", "Schneller Fund", "quite quickly", "schneller Cache", "netter Cache", "Ohne Schwierigkeiten", "ohne Schwierigkeiten", "snel gevonden", "Snel gevonden", "directly found", "gemakkelijk gevonden", "seconden gevonden", "vlot gevonden", "leuke park", "vlug gevonden", "Leuk plekje", "leuk plekkie", "Mooi verstopt", "Makkelijk gevonden", "heerlijke wandeling", "Leuke locatie", "Leuke ronde", "Leuk verstopt", "leuke wandeling", "Mooie cacheplek", "traumhaft schoen", "gut zu finden", "nix gefaehrlich", "Feines Versteck", "schoener Cache", "Toller Cache", "mit tollen Finale", "loesbaren Aufgaben", "tollen locations", "Schoene Strecke", "sehr gut gefallen", "schnell geloest", "kein Problem", "interessanter Ort", "Netter Cache", "Schneller Zugriff", "Tolle Stationen", "Schneller Cache", "schneller fund", "Fast Found", "schnellen Cache", "quickly found", "schoenste cache", "Coole Idee", "nette Lage", "super gefunden", "Mooi plekje", "nicht lange verstecken", "Nette kleine Runde", "Interessanter Ort", "super Versteck", "fix gefunden", "muggelfrei", "kurz angehalten", "ohne Problem", "nette Location", "schoener Spaziergang", "schoener Platz", "schoene idee", "Super Idee", "schoene Ecke", "gut zu loggen", "dennoch schoen", "lehrreicher Cache", "problemlos loggen", "sind begeistert", "Muggelfrei", "Coole Location", "Schoene Location", "Nett gemacht", "Problemlos gefunden", "fantastic location", "really enjoyed", "beautiful walk", "lovely view", "Great cache", "great spot", "lovely spot", "wonderful viewpoint", "keine Muggel", "toller Cache", "schoene Cachelocation");
var textneg = new Array("was difficult to find", "many possible places", "seems to be destroyed", "didn't find the cache", "find a lot of garbage", "nearly giving up", "by accident", "not easily to find", "hard time finding", "cache was not there", "to no avail", "thoroughly searched the area", "couldn't find anything", "garbage", "Trotz Spoiler", "laenger suchen", "Despite spoiler", "looked for ages", "we searched and searched", "search quite a while", "even with a spoiler picture", "hard to find", "Didn't find it", "cache box is broken", "very very hard", "could not find", "but quite hard", "haerteste Dose", "nicht unbedingt leichter", "aborted the search", "didn't find it", "Are you joking", "much more time", "very difficult", "but worse", "zweiten Anlauf", "3. Anlauf", "nicht gefunden", "Leider waren die Stationen", "zusaetzlich gelaufen", "keinerlei Hinweise", "etwas laenger gedauert", "mit hilfe gefunden", "Telefonjoker", "beim zweiten Versuch", "viele Muggels", "Spritzen", "Spritze", "hohe Muggelaufkommen", "Statistikcachen", "Suche abgebrochen", "ausgedehnter Suche", "Cache nicht finden", "keine Dose finden", "nix gefunden", "jedoch leider", "zweiten Versuch", "nichts gefunden", "nochmal versucht", "war nicht mehr da", "niets gevonden", "niet kunnen vinden", "half uur gezocht", "niet gevonden", "Tweemaal gezocht", "aardig tijdje gezocht", "couldn't find", "was haben wir gesucht", "dritten Anlauf", "Hinweis von", "habe ich abgebrochen", "halbstuendiger Suche", "Brennesseln", "Owner mal nachsehen", "2. Versuch", "gesucht wie die Bloeden", "Enttaeuschung", "Gummistiefel", "Sumpf", "matschig", "Fehlpeilung", "Zecken", "Muecken", "aeusserst schwer", "schwer zu finden", "nur raten", "Schlamm", "Zickzack", "Statistikmikro", "Sinnlosstelle", "zum Affen", "lange Wanderung", "Hinweis vom Owner", "Tip vom owner", "Suche abbrechen", "fast verzweifelt", "kurz davor aufzugeben", "eine Stunde gesucht", "Nicht gefunden", "nicht finden", "Lust ausging", "extrem feucht", "aufgegeben", "Brennnessel", "gemuggelt", "Glasscherben", "Machete", "Insektenspray", "Dornen", "3.Anlauf", "gescheitert", "Ordnungsamt", "Zutritt ist verboten", "Ordnungshueter", " TJ ", "Reinfall", "wurde zerstoert", "exponierte Lage", "im Muell", "Wachdienst", "has been muggled", "third time", "leider erfolglos", "telefonischer Hilfe");
function ColorizeLogs(LogsHtml, bPlusMinus)
{
strPlusMinus="";
for (var c=0; c0)
{
LogsHtml = LogsHtml.substr(0,pos1) + ""+tag+"" + LogsHtml.substr(pos1+tag.length);
strPlusMinus+="+";
}
else d=99;
}
}
for (var c=0; c0)
{
LogsHtml = LogsHtml.substr(0,pos1) + ""+tag+"" + LogsHtml.substr(pos1+tag.length);
if (bPlusMinus==+1) strPlusMinus+="-";
else strPlusMinus+="-";
}
else d=99;
}
}
if (bPlusMinus) return(strPlusMinus);
else return(LogsHtml);
}
function gcmain()
{
html = document.body.innerHTML;
//Rating-Text entfernen:
html = MyReplace(html, "(1 is easiest, 5 is hardest", ")");
//A cache by vereinfachen
pos1 = html.indexOf("\xa0"+"cache", 0);
if (pos1!=-1)
{
pos2=pos1;
while (pos2>0 && html.substr(pos2, 1)!="A") pos2--;
html = html.substr(0,pos2) + html.substr(pos1+6);
}
jeeeplink = MyExtract(html, "http://www.mapquest.com/maps/map.adp?searchtype=address&", "zoom=10");
jeeeplinkx = MyExtract(jeeeplink, "latitude=", "&");
jeeeplinky = MyExtract(jeeeplink, "longitude=", "&");
idotx=jeeeplinkx.indexOf(".", 0);
idoty=jeeeplinky.indexOf(".", 0);
jeeeplinkx = jeeeplinkx+String("000000").substr(0,6-(jeeeplinkx.length-idotx-1));
jeeeplinky = jeeeplinky+String("000000").substr(0,6-(jeeeplinky.length-idoty-1));
jeeeplinkx2 = String(jeeeplinkx).replace(".", "");
jeeeplinky2 = String(jeeeplinky).replace(".", "");
googlemap = "";
googlemap = googlemap+""
googlemap = googlemap+""
googlemap = googlemap+" | "
googlemap = googlemap+"
"
googlemap = googlemap+"";
//alert(googlemap);
html = MyReplaceWithBetween(html, "Logged Visi", "ts (", googlemap+"
Logged Visits (") //+"
Logged Visi", "ts (", googlemap+"
Logged Visits (") //+"
", "") //Disclaimer entfernen
html = MyReplace(html, "") //Printer-Friendly
html = MyReplaceWithBetween(html, "UTM: ", "", "") //UTM
html = MyReplace(html, "[Print:
", "")
//Download
html = MyReplace(html, "Download: ", "")
html = MyReplace(html, "")
//Attributes:
Attributes = "";
AttributesHtml = MyExtract(html, "Attributes
", "");
while (1)
{
Attribute = MyExtract(AttributesHtml, "alt=\"", "\" title");
if (Attribute=="") break;
AttributesHtml = MyReplace(AttributesHtml, "alt=\"", "\"");
if (Attribute!="blank" && Attribute!="no off-road vehicles" && Attribute!="bikes allowed" && Attribute!="no snowmobiles" && Attribute!="quads allowed" && Attribute!="horses allowed" && Attribute!="not wheelchair accessible" && Attribute!="wheelchair accessible" && Attribute!="no dogs" && Attribute!="not stroller accessible" && Attribute!="picnic tables available" && Attribute!="dogs allowed" && Attribute!="campfires allowed" && Attribute!="telephone nearby" && Attribute!="no camping" && Attribute!="no telephone" && Attribute!="no difficult climbing" && Attribute!="public transit available" && Attribute!="stroller accessible" && Attribute!="kid friendly" && Attribute!="motorcycles allowed")
{
if (Attribute=="recommended at night") Attribute="rec. at night";
if (Attribute=="takes less than 1 hour") Attribute="<1 hour";
if (Attribute=="takes more than 1 hour") Attribute=">1 hour";
if (Attribute=="available 24-7") Attribute="24-7";
if (Attribute=="not available 24-7") Attribute="not 24-7";
if (Attribute=="access/parking fees") Attribute="access/parking fees";
if (Attribute=="needs maintenance") Attribute="needs maintenance";
if (Attributes!="") Attributes = Attributes + ", ";
Attributes = Attributes + Attribute;
}
}
//Gibt es ein Spoilerbild?
SpoilerPosition = MyExtract(html, "Geocaching.com Google Map", "Cache Logs");
if (SpoilerPosition.indexOf("Spoiler")!=-1 || SpoilerPosition.indexOf("spoiler")!=-1 || SpoilerPosition.indexOf("SPOILER")!=-1) Attributes = "SPOILERBILD!!! " + Attributes;
//Logs:
LogInfos = ""
nLogInfos = 0;
LogsHtmlOrg = LogsHtml = MyExtract(html, "Cache Logs", "CacheStats");
while (nLogInfos<5)
{
logentry = MyExtract(LogsHtml, "logContainer", "");
if (logentry=="") break;
LogsHtml = MyReplace(LogsHtml, "logContainer", "");
logentrybegin = MyExtract(logentry, ">", "align=\"absmiddle\">");
LogInfo = MyExtract(logentry, "align=\"absmiddle\">", "by ");
CacherExp = MyExtract(logentry, "by ");
if (Cacher!="") Cacher = "");
Cacher = MyReplace(Cacher, "");
CacherExp = MyExtract(CacherExp, " (", " found)");
Cacher = Cacher+"("+CacherExp+")";
if (LogInfo!="")
{
LogInfo = LogInfo.substr(0, LogInfo.length-1);
LogInfo = MyReplaceWith(LogInfo, "January", "Jan");
LogInfo = MyReplaceWith(LogInfo, "February", "Feb");
LogInfo = MyReplaceWith(LogInfo, "March", "Mar");
LogInfo = MyReplaceWith(LogInfo, "April", "Apr");
LogInfo = MyReplaceWith(LogInfo, "June", "Jun");
LogInfo = MyReplaceWith(LogInfo, "July", "Jul");
LogInfo = MyReplaceWith(LogInfo, "August", "Aug");
LogInfo = MyReplaceWith(LogInfo, "September", "Sep");
LogInfo = MyReplaceWith(LogInfo, "October", "Oct");
LogInfo = MyReplaceWith(LogInfo, "November", "Nov");
LogInfo = MyReplaceWith(LogInfo, "December", "Dec");
logpre=logpost="";
if (logentrybegin.indexOf("icon_smile")!=-1 || logentrybegin.indexOf("icon_camera")!=-1 || logentrybegin.indexOf("icon_maint")!=-1 || logentrybegin.indexOf("icon_enabled")!=-1 || logentrybegin.indexOf("icon_rsvp")!=-1)
logpre = "";
if (logentrybegin.indexOf("icon_disabled")!=-1 || logentrybegin.indexOf("big_smile")!=-1 || logentrybegin.indexOf("icon_sad")!=-1 || logentrybegin.indexOf("icon_remove")!=-1 || logentrybegin.indexOf("icon_needsmaint")!=-1)
{
logpre = "";
strPlusMinus = ColorizeLogs(logentry, -1);
}
else
strPlusMinus = ColorizeLogs(logentry, +1);
if (logpre!="") logpost="";
if (logentrybegin.indexOf("icon_smile")!=-1) LogInfo = Cacher+" found"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("icon_camera")!=-1) LogInfo = Cacher+" fotographed"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("icon_maint")!=-1) LogInfo = Cacher+" maintained"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("icon_enabled")!=-1) LogInfo = Cacher+" enabled"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("icon_disabled")!=-1) LogInfo = Cacher+" disabled"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("icon_note")!=-1) LogInfo = Cacher+" wrote note"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("big_smile")!=-1) LogInfo = Cacher+" (Admin) wrote"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("icon_sad")!=-1) LogInfo = Cacher+" didn't find"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("traffic_cone")!=-1) LogInfo = Cacher+" archived"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("icon_remove")!=-1) LogInfo = Cacher+" requested remove"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("icon_rsvp")!=-1) LogInfo = Cacher+" will attend"+strPlusMinus+" "+LogInfo;
if (logentrybegin.indexOf("icon_needsmaint")!=-1) LogInfo = Cacher+" suggests maintainance"+strPlusMinus+" "+LogInfo;
if (LogInfos!="") LogInfos = LogInfos + ", ";
LogInfos = LogInfos + logpre+LogInfo+logpost;
nLogInfos++;
}
}
//Markieren:
LogsHtml = LogsHtmlOrg;
LogsHtml = ColorizeLogs(LogsHtml, false);
html = MyReplaceWith(html, LogsHtmlOrg, LogsHtml);
//Cachetype:
Cachetype = MyExtract(html, "alt=\"Size: ", "\" ");
if (html.indexOf("alt=\"Multi-cache\"", 0)!=-1) Cachetype = Cachetype + " multi";
if (html.indexOf("alt=\"Traditional Cache\"", 0)!=-1) Cachetype = Cachetype + " single";
if (html.indexOf("alt=\"Unknown Cache\"", 0)!=-1) Cachetype = Cachetype + " unknown";
if (html.indexOf("alt=\"Webcam Cache\"", 0)!=-1) Cachetype = Cachetype + " webcam";
if (html.indexOf("alt=\"Earthcache\"", 0)!=-1) Cachetype = Cachetype + "Earth";
if (html.indexOf("alt=\"Letterbox Hybrid\"", 0)!=-1) Cachetype = Cachetype + " letterbox";
if (html.indexOf("alt=\"Event Cache\"", 0)!=-1) Cachetype = Cachetype + "Event";
if (html.indexOf("alt=\"Mega-Event Cache\"", 0)!=-1) Cachetype = Cachetype + "Mega event";
html = MyRemove(html, "(Small)");
html = MyRemove(html, "(Regular)");
html = MyRemove(html, "(Micro)");
//Cacheowner:
Cacheowner = MyExtract(html, "", "");
CacheownerName = MyExtract(Cacheowner, ">", "<");
html = MyReplaceWithBetween(html, "", "", ""+Cacheowner+" ("+Cachetype+" Cache)
"+Attributes+"
"+LogInfos+"");
//OwnerHP:
html = MyReplace(html, "", "User's Web Page") //Click Icon to download
//Hidden:
html = MyRemove(html, "Hidden:")
html = MyReplace(html, "")
html = MyReplace(html, "")
html = MyReplace(html, "", "") //Decryption key
//Spoiler Warning:
html = MyReplace(html, "", "")
html = MyReplace(html, "", "")
html = MyReplaceWithBetween(html, "
Totals by", "log type", "Totals by log type")
html = MyRemove(html, "Cache find counts are based on the last time the page generated. ")
document.body.innerHTML = html;
}
//document.addEventListener('load',function(e) {window.n();}, false);
if (isfirefox()) gcmain();
else document.addEventListener('load',function(e) {gcmain();}, false);
})();