Skip to content

Instantly share code, notes, and snippets.

@spudtrooper
Created October 10, 2011 02:55
Show Gist options
  • Select an option

  • Save spudtrooper/1274537 to your computer and use it in GitHub Desktop.

Select an option

Save spudtrooper/1274537 to your computer and use it in GitHub Desktop.
Opens a foursquare location in google maps
(function() {
var html = String(document.body.innerHTML);
var res = html.match(/GLatLng\s*\(\s*(-?\d+\.?\d*)\s*,\s*(-?\d+\.?\d*)\s*\)/);
if (res) {
var lat = res[1], lng = res[2];
var title = document.getElementsByTagName('h1')[0].innerHTML;
var link = 'http://maps.google.com/maps?q='
+ escape(title) + '@' + lat + ',' + lng;
window.open(link,'_');
} else {
alert('Bad monkey');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment