Skip to content

Instantly share code, notes, and snippets.

@Reinachan
Last active October 24, 2022 13:01
Show Gist options
  • Save Reinachan/0e2d1b72cb959581f3fac805d9482dbb to your computer and use it in GitHub Desktop.
Save Reinachan/0e2d1b72cb959581f3fac805d9482dbb to your computer and use it in GitHub Desktop.
AniList Emoji Conversion Tool

AniList Emoji Conversion Tool

As many who make posts on AniList might already know, all emoji will end up rendered as ?? instead of an actual emoji. For a while we've had this tool that another AniList user made but it's kinda annoying to have to run it through there first before posting. So I've made this easy-to-use bookmarklet to solve this problem.

For iOS Users

You can alternatively install it as a Shortcut. Either metho will work so it's just a matter of preference.

Instructions

  1. Copy the contents of the first file here
  2. Create a bookmark and paste this into the url field
  3. Write a post on AniList with emoji or other characters that don't work
  4. Use the bookmarklet before posting

For Android users that use Chrome, you'll have to follow this guide when you create the bookmarklet or it won't work (just replace "console" with whatever you call this one)

Credits

I took the conversion part of the code from here

javascript:(function(){let textInput=document.querySelectorAll('textarea');const inputLength=textInput.length;function replaceEmoji(inValue){let result='';for(let i=0;i<inValue.value.length;i+=1){var code=inValue.value.codePointAt(i);if(code>0xFFFF){result+=['&#',code,';'].join('');i+=1}else{result+=String.fromCodePoint(code)}}return result}for(let i=0;i<inputLength;i+=1){const input=textInput[i];if(input.value){textInput[i].value=replaceEmoji(input);textInput[i].dispatchEvent(new Event('input'))}}})();
javascript:(function () {
let textInput = document.querySelectorAll('textarea');
const inputLength = textInput.length;
function replaceEmoji(inValue) {
let result = '';
for (let i = 0; i < inValue.value.length; i += 1) {
var code = inValue.value.codePointAt(i);
if (code > 0xFFFF) {
result += ['&#', code, ';'].join('');
i += 1;
} else {
result += String.fromCodePoint(code);
}
}
return result;
}
for (let i = 0; i < inputLength; i += 1) {
const input = textInput[i];
if (input.value) {
textInput[i].value = replaceEmoji(input);
textInput[i].dispatchEvent(new Event('input'))
}
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment