Skip to content

Instantly share code, notes, and snippets.

@adeel
Created October 16, 2022 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeel/c3638508ad73cfd37343609df50f2315 to your computer and use it in GitHub Desktop.
Save adeel/c3638508ad73cfd37343609df50f2315 to your computer and use it in GitHub Desktop.
bookmarklet for downloading pdf from arXiv (with filename: "Author1-Author2 - Title.pdf")
var title = $$("h1.title")[0].innerText;
var authors = $$(".authors a").map(a => a.innerText.split(" ").pop()).join("-");
var link = $$("a.download-pdf")[0];
link.download = authors + " - " + title + ".pdf";
link.click();
javascript:(function()%7Bvar%20title%20%3D%20%24%24(%22h1.title%22)%5B0%5D.innerText%3B%0Avar%20authors%20%3D%20%24%24(%22.authors%20a%22).map(a%20%3D%3E%20a.innerText.split(%22%20%22).pop()).join(%22-%22)%3B%0Avar%20link%20%3D%20%24%24(%22a.download-pdf%22)%5B0%5D%3B%0Alink.download%20%3D%20authors%20%2B%20%22%20-%20%22%20%2B%20title%20%2B%20%22.pdf%22%3B%0Alink.click()%3B%7D)()%3B;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment