Arxiv Old Author Search

Resets author links on the arxiv to use the old search

  1. // ==UserScript==
  2. // @name Arxiv Old Author Search
  3. // @namespace https://gf.qytechs.cn/en/scripts/367695-arxiv-old-author-search
  4. // @description Resets author links on the arxiv to use the old search
  5. // @include http://arxiv.org/*
  6. // @include https://arxiv.org/*
  7. // @version 3
  8. // @license MIT
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var i;
  13. var link_target;
  14. var argument_start;
  15. var author_name, fixed_author_name;
  16.  
  17. var arxiv_context = "";
  18. var links = document.getElementsByTagName("a");
  19. var header_links = document.getElementById("header").getElementsByTagName("a");
  20.  
  21. // We first need the context: hep-th, cond-mat and so on
  22. for (i = 0; i < header_links.length; i++) {
  23. link_target = header_links[i].getAttribute("href");
  24. argument_start = link_target.indexOf("recent");
  25. if (argument_start < 0) continue;
  26. arxiv_context = header_links[i].innerHTML;
  27. }
  28.  
  29. for (i = 0; i < links.length; i++) {
  30. link_target = links[i].getAttribute("href");
  31. if (link_target == null) continue;
  32. argument_start = link_target.indexOf("?searchtype=author&query=");
  33. if (argument_start < 0) continue;
  34. author_name = link_target.substring(argument_start + 25).replace(",+", "_").replace("%2C+", "_");
  35. // Limit the number of initials to one
  36. fixed_author_name = author_name.replace(/\+.*/, "");
  37. // Replace the link
  38. links[i].setAttribute("href", "https://arxiv.org/find/" + arxiv_context + "/1/au:+" + fixed_author_name + "/0/1/0/all/0/1");
  39. }

QingJ © 2025

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