Skip to content

Instantly share code, notes, and snippets.

@petzku
Last active January 25, 2022 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petzku/21c66365005098688aad08846f7e973e to your computer and use it in GitHub Desktop.
Save petzku/21c66365005098688aad08846f7e973e to your computer and use it in GitHub Desktop.
Sanuli emoji copy-paste
// "minified", copy-paste this into a bookmarklet URL
javascript: (() => {$=(...args)=>document.querySelector(...args);h=$("h1").textContent.replace("#","");s="";n=0;d=$("div.board-6");for(row of d.children){if(row.children[0].classList[1]!=="unknown"){s+="\n";for(letter of row.children){cl=letter.classList[1];s+=cl[0]}n++}}s=s.replaceAll('a','⬛').replaceAll('p','🟨').replaceAll('c','🟩');r=h+" "+n+"/6\n"+s;navigator.clipboard.writeText(r)})();
// Rakenna wordlen share-napin tyylisesti emojeilla helposti jaettava viesti
function convert_to_emoji() {
$ = (...args) => document.querySelector(...args);
h = $("h1").textContent.replace("#","");
s = ""; n = 0;
d = $("div.board-6");
for (row of d.children) {
if (row.children[0].classList[1] !== "unknown") {
s += "\n";
for (letter of row.children) {
cl = letter.classList[1];
s += cl[0];
}
++n;
}
}
s = s.replaceAll('a', '⬛').replaceAll('p', '🟨').replaceAll('c', '🟩');
r = h + " " + n + "/6\n" + s;
navigator.clipboard.writeText(r);
return r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment