Created
October 10, 2011 02:55
-
-
Save spudtrooper/1274537 to your computer and use it in GitHub Desktop.
Opens a foursquare location in google maps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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