Provisionning pdf from shell
Hello,
Is there any command to send a pdf (or any other type of) file into my opened zotero library with a shell command ?
I work under linux and for certain activities, I would need to script my zotero provisioning.
Anyone to help ?
Thanks,
Olivier
Is there any command to send a pdf (or any other type of) file into my opened zotero library with a shell command ?
I work under linux and for certain activities, I would need to script my zotero provisioning.
Anyone to help ?
Thanks,
Olivier
We're planning to make it possible to "open" local PDFs via Zotero and then run metadata retrieval on them, though that would result in a prompt in the UI (similar to when you open a RIS file via Zotero).
There are ways to script this entirely locally, but they'd be a bit more complicated, so see if the API approach works first.
thank you Dan for your response. As I understand it, pyzotero methods like "Zotero.attachment_..." could help me then.
However, I'd prefer to talk directly with a local zotero opened instance really. What I would need is simply to send pdf files into my zotero library from a shell (or a shell script). I suspect that it's possible to send some commands to do that to the localhost through port 23119 ?
Olivier
https://forums.zotero.org/discussion/75569/client-scripting-api-with-zotero-standalone-v5
Let's go for investigations :-)
I've been able to push a web page into my library from a shell using the three following three commands :
#get the web page to store
$ curl -fsSo /tmp/doc http://url-to-store
# generate the json db file to be used by zotero
$ jq -cn --arg uri http://url-to-store --rawfile html /tmp/tmpdoc '{url: $uri, html: $html, cookie: ""}' > /tmp/tmpjson
# push to zotero with method "saveSnapshot"
$ curl -vfH Expect: -H 'Content-Type: application/json' --data-binary "@/tmp/tmpjson" "http://localhost:23119/connector/saveSnapshot"
Unfortunatly, I have not been able to push a pdf file since I have not found which method/json format should be used to push a binary file such as pdf.
Could you help ?
Thanks,
---
Olivier
https://github.com/sdx23/zotadd
Feedback welcome.
Myself, I extremely rarely use the URL of an attachment, so I'm just gonna life with it.
I was wondering how should I specify a specific library/collection into which all documents pushed with zotadd would be stored.
For example, I plan to push certain incoming mails automatically to a specific library called "mails" into a specific collection called "incoming".
I have tried to include in the json part of "zotadd" a parameter "collection", but it doesn't work. Any help ?