arXiv Link Downloader

Download arXiv links as an Excel file

  1. // ==UserScript==
  2. // @name arXiv Link Downloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Download arXiv links as an Excel file
  6. // @author You
  7. // @match https://arxiv.org/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Create a button to trigger the link download
  16. const button = document.createElement('button');
  17. button.textContent = 'arXiv Links\n一键下载';
  18. button.style.position = 'fixed';
  19. button.style.top = '120px';
  20. button.style.right = '10px';
  21. button.style.zIndex = 1000;
  22. document.body.appendChild(button);
  23.  
  24. // Function to extract links and create Excel content
  25. function downloadLinks() {
  26. const links = document.querySelectorAll('li.arxiv-result .list-title a[href^="https://arxiv.org/abs/"]');
  27. let excelContent = "Link\n";
  28.  
  29. links.forEach(link => {
  30. const url = link.href.trim();
  31. excelContent += `"${url}"\n`;
  32. });
  33.  
  34. // Create a Blob object with Excel content
  35. const blob = new Blob([excelContent], { type: 'text/csv;charset=utf-8;' });
  36. const blobURL = URL.createObjectURL(blob);
  37.  
  38. // Create a temporary link to trigger the download
  39. const tempLink = document.createElement('a');
  40. tempLink.href = blobURL;
  41. tempLink.setAttribute('download', 'arxiv_links.csv');
  42. document.body.appendChild(tempLink);
  43. tempLink.click();
  44. document.body.removeChild(tempLink);
  45. }
  46.  
  47. // Add event listener to the button
  48. button.addEventListener('click', downloadLinks);
  49. })();

QingJ © 2025

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