Advertisement
jcunews

EpigraphicListExtractToCSV bookmarklet

Mar 28th, 2022
1,291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript:/*EpigraphicListExtractToCSV*/
  2. ((u, t) => {
  3.   if (location.href !== (u = "https://db.edcs.eu/epigr/epi_ergebnis.php")) {
  4.     if (confirm("This bookmarklet is only for website page with below URL:\n" + u + "\n\nOpen that page now?")) open(t);
  5.     return
  6.   }
  7.   t = [];
  8.   document.querySelectorAll('a[href*="bilder.php"]').forEach((lnk, rec) => {
  9.     rec = lnk.textContent + '\t' + lnk.parentNode.querySelector('a[href*="bilder.php"]~noscript+br').nextSibling.data.trim();
  10.     lnk.href.match(/bild=([^&]+)/)[1].split(";").forEach((fn, m, e) => {
  11.       if (fn !== "pp") rec += "\thttps://db.edcs.eu/epigr/bilder/" + fn + (!fn.includes(".jpg") && ".jpg" || "")
  12.     });
  13.     t.push(rec)
  14.   });
  15.   t = "\ufeff" + t.join("\n");
  16.   open(URL.createObjectURL(new Blob([t], {type: "text/plain"})));
  17. })()
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement