Created
September 6, 2011 12:44
-
-
Save nevan/1197447 to your computer and use it in GitHub Desktop.
Revisions
-
nevan revised this gist
Sep 6, 2011 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,11 +12,12 @@ var regex = /center=(\-?\d+\.\d+),(\-?\d+\.\d+)/ig; var match = regex.exec(text); var lat = match[1]; var lon = match[2]; var latlon = lat + "," + lon; var mapDiv = document.createElement('div'); mapDiv.id = "mapLink"; mapDiv.style.width = "395px"; mapDiv.style.height = "30px"; mapDiv.innerHTML = "<a class=\"promo\" href=\"http://google.com/maps/?q=" + latlon + "&ll=" + latlon + "\">Google Maps Link</a>"; document.getElementById('map-container').parentNode.appendChild(mapDiv, document.getElementById('map-container')); -
nevan revised this gist
Sep 6, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -18,5 +18,5 @@ mapDiv.id = "mapLink"; mapDiv.style.width = "395px"; mapDiv.style.height = "30px"; mapDiv.innerHTML = "<a class=\"promo\" href=\"http://google.com/maps/?q=" + lat + "," + lon + "\">Google Maps Link</a>"; document.getElementById('map-container').parentNode.appendChild(mapDiv, document.getElementById('map-container')); -
nevan created this gist
Sep 6, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ // ==UserScript== // @name Instagram Map Link // @namespace net.nevan // @description Add a link to Google Maps to an Instagram page // @include http://instagr.am/p/* // @include https://instagr.am/p/* // ==/UserScript== // Code borrowed from here: https://www.userscripts.org/scripts/review/103487 var text = document.getElementById('map').src; var regex = /center=(\-?\d+\.\d+),(\-?\d+\.\d+)/ig; var match = regex.exec(text); var lat = match[1]; var lon = match[2]; var mapDiv = document.createElement('div'); mapDiv.id = "mapLink"; mapDiv.style.width = "395px"; mapDiv.style.height = "30px"; mapDiv.innerHTML = "<a class=\"promo\" href=\"http://google.com/maps/?q=" + lat + "," + lon + "\">Google Map Link</a>"; document.getElementById('map-container').parentNode.appendChild(mapDiv, document.getElementById('map-container'));