Strudels

Neopets Username Blurrinator

Oct 2nd, 2025 (edited)
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name            Neopets Username Blurrinator
  3. // @namespace       http://tampermonkey.net/
  4. // @description     Context menu to blur usernames and pet names on common pages for screenshot purposes. Right-click on a page -> Tampermonkey -> Neopets Username Blurrinator to activate it. Do it again to deactivate it.
  5. // @version         1.0
  6. // @author          Rippy
  7. // @include         http*://*.neopets.com/*
  8. // @require         http://code.jquery.com/jquery-latest.js
  9. // @run-at          context-menu
  10. // ==/UserScript==
  11.  
  12.  
  13. (function() {
  14.     'use strict';
  15.     const applyBlur = (e) => {
  16.         if ($(e).text() == appInsightsUserName) { // don't blur out own username. not foolproof but eh
  17.             return;
  18.         }
  19.         if (!$("#blurrinator").length) {
  20.             $(e).css({
  21.                 "filter": "blur(6px)",
  22.                 "-webkit-filter": "blur(6px)",
  23.                 "-moz-filter": "blur(6px)",
  24.                 "-o-filter": "blur(6px)",
  25.                 "-ms-filter": "blur(6px)"
  26.             });
  27.         }
  28.         else {
  29.             $(e).css({
  30.                 "filter": "blur(0px)",
  31.                 "-webkit-filter": "blur(0px)",
  32.                 "-moz-filter": "blur(0px)",
  33.                 "-o-filter": "blur(0px)",
  34.                 "-ms-filter": "blur(0px)"
  35.             });
  36.         }
  37.     }
  38.     const processPage = () => {
  39.         $("a[href*='userlookup.phtml?user='], a[href*='randomfriend.phtml?user='], a[href*='randomfriend.phtml?randomfriend='], a[href*='browseshop.phtml?owner='], a[href*='/gallery/index.phtml?gu='], a[href*='/trophy.phtml?username='], a[href*='/petlookup.phtml?pet=']").each(function (k, v) {
  40.             // heavily derived from diceroll123's User Tagger https://gist.github.com/diceroll123/be1465e82d12f2d23d8a w/ minor modifications
  41.             applyBlur(v);
  42.         });
  43.         if (window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/island\/tradingpost.phtml*/)) { // tp
  44.             $("p > b").each((i, e) => {
  45.                 applyBlur(e);
  46.             });
  47.         }
  48.         if (window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/auctions.phtml*/)) { // auction house
  49.             if (window.location.href.includes("auction_id")) { // specific auctions
  50.                 $("b").each((i, e) => {
  51.                     if (e.innerText.match(/\(owned by (.+)\)/)) {
  52.                         applyBlur(e);
  53.                     }
  54.                 });
  55.                 $("table:eq(7) tr td:nth-child(1)").each((i, e) => {
  56.                     if (i > 0) {
  57.                         applyBlur(e);
  58.                     }
  59.                 });
  60.             }
  61.             else {
  62.                 $("table:eq(9) tr td:nth-child(4), table:eq(9) tr td:nth-child(8)").each((i, e) => { // auction main pages
  63.                     if (i > 0) {
  64.                         applyBlur(e);
  65.                     }
  66.                 });
  67.             }
  68.         }
  69.         if (window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/genie.phtml*/)) { // auction genie
  70.             $("table:eq(7) tr td:nth-child(4), table:eq(7) tr td:nth-child(8)").each((i, e) => {
  71.                 if (i > 0) {
  72.                     applyBlur(e);
  73.                 }
  74.             });
  75.         }
  76.         if (window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/donations.phtml*/)) { // money tree
  77.             $(".item-benefactor > b").each((i, e) => {
  78.                 applyBlur(e);
  79.             });
  80.         }
  81.         if ($("#blurrinator").length) {
  82.             $("#blurrinator").remove();
  83.         }
  84.         else {
  85.             $("<div id='blurrinator' style='display: none;'></div>").insertAfter($("body"));
  86.         }
  87.     }
  88.     processPage();
  89. })();
Advertisement
Add Comment
Please, Sign In to add comment