Advertisement
Guest User

https://greasyfork.org/en/scripts/434552-r-forsen-emotes-for-old-reddit/code

a guest
Oct 27th, 2021
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function () {
  2.         // 5317 = forsenE
  3.         // 5318 = gachiBass
  4.         // 5319 = forsenDespair
  5.         // 5320 = forsenBased
  6.         // 5321 = OMEGALUL
  7.         // 5322 = megaLUL
  8.         // 5323 = forsenCope / Copesen
  9.         // 5324 = PagMan
  10.         // 5325 = Sadeg
  11.         // 5326 = forsenCD
  12.         // 5327 = BatChest
  13.         // 5330 = :tf: / Trollface
  14.         // 5331 = Clueless
  15.         // 5332 = monkaOMEGA
  16.         // 5333 = WutFace
  17.         // 5334 = cmonBruh
  18.         // 5335 = pepeLaugh
  19.         // 5336 = FeelsOkayMan
  20.         // 5359 = forsen as doc
  21.         // 5360 = LULE
  22.        
  23.         var emotes = {
  24.           ":5317:": "https://reddit-econ-prod-assets-permanent.s3.amazonaws.com/asset-manager/t5_33td5/AT7s0VNX3k.png",
  25.           ":5323:": "https://reddit-econ-prod-assets-permanent.s3.amazonaws.com/asset-manager/t5_33td5/35Audg7pV4.png",
  26.           "emote_key": "image_link" // add your emotes here
  27.         };
  28.         var emoteMatcher = Object.keys(emotes).join('|');
  29.    
  30.         var emoteSize = 20; //change these if you want the emotes to be bigger or smaller, it's 20 on new reddit so i just used that
  31.    
  32.         Array.from(document.getElementsByTagName("p")).forEach(function (elem) {
  33.             var html = elem.innerHTML;
  34.             var emoteMatches = html.match(new RegExp(emoteMatcher, 'g'));
  35.             if (emoteMatches) {
  36.                 emoteMatches.forEach(function (possibleEmote) {
  37.                     if (emotes.hasOwnProperty(possibleEmote))
  38.                         html = html.replace(possibleEmote, `<img src="${emotes[possibleEmote]}" width="${emoteSize} height="${emoteSize}">`);
  39.                });
  40.                elem.innerHTML = html;
  41.            }
  42.        });
  43.    })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement