Skip to content

Instantly share code, notes, and snippets.

@ptrcnull
Forked from simeonlg/bookmarklet
Last active September 18, 2018 10:13
Show Gist options
  • Save ptrcnull/40cf9fae13d80189fa47bbb41b9ffb71 to your computer and use it in GitHub Desktop.
Save ptrcnull/40cf9fae13d80189fa47bbb41b9ffb71 to your computer and use it in GitHub Desktop.
Pokemongomap.info scraper
javascript:(function()%7Bvar%20l%3DObject.values(markers).map(m%3D%3E%60%24%7Bm.options.locmarkername%7D%20-%20%24%7Bm._latlng.lat.toFixed(5)%7D%2C%24%7Bm._latlng.lng.toFixed(5)%7D%60).join('%5Cn')%3Bvar%20e%3Ddocument.createEvent('MouseEvents')%3Be.initMouseEvent('click'%2Ctrue%2Cfalse%2Cself%2C0%2C0%2C0%2C0%2C0%2Cfalse%2Cfalse%2Cfalse%2Cfalse%2C0%2Cnull)%3Bvar%20a%3Ddocument.createElement('a')%3Ba.download%3D'locations.txt'%3Ba.href%3D'data%3Atext%2Fplain%3Bcharset%3Dutf-8%2C'%2BencodeURIComponent(l)%3Ba.dispatchEvent(e)%7D)()
const markerList = Object.values(markers).map(m => `${m.options.locmarkername} - ${m._latlng.lat.toFixed(5)},${m._latlng.lng.toFixed(5)}`).join('\n');
var ev = document.createEvent('MouseEvents');
ev.initMouseEvent('click', true, false, self, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
var a = document.createElement('a');
a.download = 'locations.txt';
a.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(markerList);
a.dispatchEvent(ev);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment