Skip to content

Instantly share code, notes, and snippets.

@mrandyclark
Created July 5, 2017 21:28
Show Gist options
  • Save mrandyclark/fb58f00b042db7c3b39972476002574a to your computer and use it in GitHub Desktop.
Save mrandyclark/fb58f00b042db7c3b39972476002574a to your computer and use it in GitHub Desktop.
javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3Bfunction%20getSafeName(name)%20%7Breturn%20name.replace(%2F%5B%5EA-Z0-9%5D%2B%2Fig%2C%20'').toLowerCase()%3B%7Dvar%20data%20%3D%20%5B%5D%3B%24(%22.player-name%22).each(function()%20%7Bvar%20name%20%3D%20%24(this).text().trim()%3Bdata.push(%7Bname%3A%20name%2CsafeName%3A%20getSafeName(name)%7D)%3B%7D)%3Bvar%20fileName%20%3D%20%22field.json%22%3Bvar%20encodedData%20%3D%20encodeURIComponent(JSON.stringify(data))%3Bvar%20downloadData%20%3D%20%22text%2Fjson%3Bcharset%3Dutf-8%2C%22%20%2B%20encodedData%3Bvar%20link%20%3D%20document.createElement(%22a%22)%3Blink.setAttribute(%22href%22%2C%20(%22data%3A%22%20%2B%20downloadData)%20)%3Blink.setAttribute(%22download%22%2C%20fileName)%3Blink.click()%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment