Geocaching and Waymarking Stats Bar Redirector
Geocaching.com has a nice Stats Bar which you can put on your own web page to show your geocaching statistics. They even give you a form where you can create your own Stats Bar.
The problem is, the Stat Bar it creates is a "dynamic" image, and some web hosts, such as MySpace and the Groundspeak forums, don't let you show dynamic images. With the form below, we can fake those websites into thinking it's a "static" image.
How It Works
This works by modifying the URL of the image to look like a static image instead of a dynamic image. You can recognize a dynamic image by the question mark in the middle of the URL, as well as the equals signs and ampersands after the question mark. A static image has none of those. It just looks like a regular path to a .jpg image.
The URL for a geocaching Stat Bar is:
The form above creates a URL that looks like:
I wrote a few lines of code to put on my server (in the .htaccess) file which will take such a static URL and rewrite it to a dynamic URL on geocaching.com.
You can use this static URL on your website or forum message, and when a browser asks my server for the image, my server replies with "sorry, it's not here, try over there" and returns the dynamic URL. The browser will then ask img.geocaching.com for the image and display it. All this without anyone even realizing what is happening.
The exact format of the URL that my server recognizes is:http://www.lildevil.org/stats/gc/your guid/image number/text to display.jpg
your guid is that 36 character alpha-numeric string attached to your profile.
image number is 1 (one) for the geocaching logo, or 2 (two) for Signal the Frog. This part is optional and will default to the geocaching logo.
text to display is the text you want to show beneath your hides and finds. Use plus signs in place of spaces.
It must end with .jpg or .png
Feel free to use this as much as you want. There's very little bandwidth impact on my server, as I'm not serving the images, just redirecting the URL.
|February, 2007||First release.|
|August 1, 2007||Added form to parse the guid and other variables out of the html generated by geocaching.com.|
|August 24, 2008||Added support for Waymarking stat bar and added /gc/ to the Geocaching URL for better clarification. Old URLs without /gc/ will continue to be supported.|
|September 4, 2008||Fixed code to remove extra quote in image URLs.|
|January 28, 2010||Fixed to properly encode special characters in the Text to display beneath your hides/finds.|