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 https://www.andrewheiss.com/research/
@andrew You mean like this?
https://api.crossref.org/works/10.1038/nrd842/transform/application/x-bibtex
Just put anything between "works/" and "/transform" and it will return bibtex information.
Or did you mean something else?
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)
```
@johnabs this is so cool!! Thanks!
@andrew No problem! Not sure if it was useful at all, but I tried 😂
@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% 😂