Discovered that you can build a URL that auto-adds #Zotero references by doi/isbn (zotero dot org slash save), so I added a neat "Add to Zotero" link to each of my papers just for fun. It's not as automated as I want it to be yet with #QuartoPub but it's still neat andrewheiss.com/research/

I wish there was a way to add bibtex stuff (or CSL YAML or something) via URL so I could customize the metadata instead of relying on Zotero's lookup to Crossref (especially for unpublished working papers), but this'll do for now

@andrew You mean like this?

api.crossref.org/works/10.1038

Just put anything between "works/" and "/transform" and it will return bibtex information.

Or did you mean something else?

@johnabs Oh wow, that's a super neat API function!

I'm looking for basically the reverse of that. Like with this DOI-less working paper here andrewheiss.com/research/worki I have BibTeX down at the bottom of the page. I can copy it, go to File > Import from clipboard in Zotero, and it'll add it as "Manuscript" type. I was hoping for some URL-based way to do that without copying it to the clipboard—one click and it somehow adds the publication based on the bibtex text

@andrew

I see...I think there's some trouble here, unless you only care about this url based method working for your WIP papers only (rather than universally).

In this more limited case, you can use a bookmarklet. Now, I'm no expert at Javascript, but it seems that you can do the following based on the website you linked. Just save the following code as a bookmark, and you can automatically copy to your clipboard from anywhere on the page, and import to zotero from there.

It would be even easier if the zotero API had a way to save from bibtex instead of just doi, because in that case we can just wrap the bookmarklet in another function and call it a day.

Hope this provides something useful you can build on or use :)

```
javascript:navigator.clipboard.writeText(document.getElementsByClassName("sourceCode").cb1.innerText)
```

Follow

@andrew Oh, and for funsies, here's the same set of sed regular expressions that will take the raw html starting at <div class="sourceCode" and do the same thing:

```
:%s/^.*\(@.*\)<\/span>\{<span class="ot">\(.*\)<\/span>,.*/\1{\2/g
:%s/.*\{\(.*\)\}.*/\{\1\}/g
```

But the bookmarklet was a lot faster to get working 100% 😂

@andrew No problem! Not sure if it was useful at all, but I tried 😂

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.