Skip to content

Instantly share code, notes, and snippets.

@kosugi
Created September 27, 2016 07:50
Show Gist options
  • Select an option

  • Save kosugi/70d63fb4b5fdd4c1d6506034458f81fe to your computer and use it in GitHub Desktop.

Select an option

Save kosugi/70d63fb4b5fdd4c1d6506034458f81fe to your computer and use it in GitHub Desktop.
bookmarklet for moving between Ingress Mission Map and Ingress Intel Map alternately
// original source
(function(host, x) {
if (host === 'ingressmm.com') {
x = Map.getCenter();
location.href = ['https://www.ingress.com/intel?ll=', x.lat(), ',', x.lng(), '&z=', Map.getZoom()].join('');
}
else if (host === 'www.ingress.com') {
x = document.cookie.split(';').reduce(function(ps, c) {
if (c.match(/\s*\bingress.intelmap.(\w+)=([-\+\d\.]+)\b\s*/)) {
ps[RegExp.$1] = RegExp.$2;
}
return ps;
}, {});
location.href=['https://ingressmm.com/?pos=', x['lat'], ',', x['lng'], '&zoom=', x['zoom']].join('')
}
})(location.host)
javascript:(function(host,x){if(host==='ingressmm.com'){x=Map.getCenter();location.href=['https://www.ingress.com/intel?ll=',x.lat(),',',x.lng(),'&z=',Map.getZoom()].join('');}else%20if(host==='www.ingress.com'){x=document.cookie.split(';').reduce(function(ps,c){if(c.match(/\s*\bingress.intelmap.(\w+)=([-\+\d\.]+)\b\s*/)){ps[RegExp.$1]=RegExp.$2;}return%20ps;},{});location.href=['https://ingressmm.com/?pos=',x['lat'],',',x['lng'],'&zoom=',x['zoom']].join('')}})(location.host)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment