Skip to content

Instantly share code, notes, and snippets.

@dontangg
Last active May 9, 2020 01:33
Show Gist options
  • Save dontangg/e46a3cc2339b0fb6fca63394e46b20ae to your computer and use it in GitHub Desktop.
Save dontangg/e46a3cc2339b0fb6fca63394e46b20ae to your computer and use it in GitHub Desktop.
Make a bookmark with this as the URL. Go to the full gear list for a character on swgoh.gg and click the bookmark. (eg https://swgoh.gg/characters/supreme-leader-kylo-ren/gear-list/)
javascript:!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.download=t()}(this,function(){return function e(t,n,o){var a,i,r=window,d="application/octet-stream",s=o||d,c=t,l=!n&&!o&&c,u=document.createElement("a"),f=function(e){return String(e)},p=r.Blob||r.MozBlob||r.WebKitBlob||f,m=n||"download";if(p=p.call?p.bind(r):Blob,"true"===String(this)&&(s=(c=[c,s])[0],c=c[1]),l&&l.length<2048&&(m=l.split("/").pop().split("?")[0],u.href=l,-1!==u.href.indexOf(l))){var b=new XMLHttpRequest;return b.open("GET",l,!0),b.responseType="blob",b.onload=function(t){e(t.target.response,m,d)},setTimeout(function(){b.send()},0),b}if(/^data\:[\w+\-]+\/[\w+\-]+[,;]/.test(c)){if(!(c.length>2096103.424&&p!==f))return navigator.msSaveBlob?navigator.msSaveBlob(v(c),m):w(c);s=(c=v(c)).type||d}function v(e){for(var t=e.split(/[:;,]/),n=t[1],o=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),a=o.length,i=0,r=new Uint8Array(a);i<a;++i)r[i]=o.charCodeAt(i);return new p([r],{type:n})}function w(e,t){if("download"in u)return u.href=e,u.setAttribute("download",m),u.className="download-js-link",u.innerHTML="downloading...",u.style.display="none",document.body.appendChild(u),setTimeout(function(){u.click(),document.body.removeChild(u),!0===t&&setTimeout(function(){r.URL.revokeObjectURL(u.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return e=e.replace(/^data:([\w\/\-\+]+)/,d),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),t||(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,d)),n.src=e,setTimeout(function(){document.body.removeChild(n)},333)}if(a=c instanceof p?c:new p([c],{type:s}),navigator.msSaveBlob)return navigator.msSaveBlob(a,m);if(r.URL)w(r.URL.createObjectURL(a),!0);else{if("string"==typeof a||a.constructor===f)try{return w("data:"+s+";base64,"+r.btoa(a))}catch(e){return w("data:"+s+","+encodeURIComponent(a))}(i=new FileReader).onload=function(e){w(this.result)},i.readAsDataURL(a)}return!0}});var csv=$(".media-list li.media").map((e,t)=>{return $(t).find(".media-heading h5").text()+","+parseInt($(t).find(".media-heading p").text().substring(1))}).toArray().join("\n");csv="Name,Total\n"+csv,window.download(csv,"FullGearList.csv","text/csv");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment