QoL Update: Neopets Userlookup Skip ReCaptcha

Converts randomfriend links to userlookup and places &place=999 before user= for all formats (user= or randomfriend=)

  1. // ==UserScript==
  2. // @name QoL Update: Neopets Userlookup Skip ReCaptcha
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Converts randomfriend links to userlookup and places &place=999 before user= for all formats (user= or randomfriend=)
  6. // @author Fatal
  7. // @match *.neopets.com/*
  8. // @license MIT
  9. // @grant none
  10. // @run-at document-end
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. function modifyUserUrl(url) {
  17. const base = 'https://www.neopets.com/userlookup.phtml';
  18.  
  19. // Match user or randomfriend params
  20. const match = url.match(/[?&](user|randomfriend)=([^&]+)/);
  21. if (url.includes('randomfriend.phtml') && match) {
  22. const username = match[2];
  23. return `${base}?place=999&user=${username}`;
  24. }
  25.  
  26. // Handle existing userlookup links
  27. if (url.includes('userlookup.phtml') && match) {
  28. const username = match[2];
  29.  
  30. // Clean the URL from existing user/place parameters
  31. let cleanUrl = url.replace(/[?&]place=[^&]*/g, '').replace(/[?&]user=[^&]*/g, '');
  32. cleanUrl = cleanUrl.split('?')[0]; // remove remaining query string
  33.  
  34. return `${base}?place=999&user=${username}`;
  35. }
  36.  
  37. return url;
  38. }
  39.  
  40. function modifyAllLinks() {
  41. const links = document.getElementsByTagName('a');
  42. for (let link of links) {
  43. const originalHref = link.href;
  44. const modifiedHref = modifyUserUrl(originalHref);
  45.  
  46. if (modifiedHref !== originalHref) {
  47. link.href = modifiedHref;
  48. }
  49. }
  50. }
  51.  
  52. modifyAllLinks();
  53.  
  54. const observer = new MutationObserver(modifyAllLinks);
  55. observer.observe(document.body, {
  56. childList: true,
  57. subtree: true
  58. });
  59. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址