Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a function for getting the non-deprecated Zotero link. #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NorwegianRockCat
Copy link

This adds functionality for getting the current "non-deprecated" form of the link (See Issue #30). I did this with a new format (zoteroLink) since I don't want to break the current keys or workflows.

This is mostly just adapted from Zutilo, but it seems to be considered the "blessed" version, so I'm keeping it for now.

I have never written a Zotero extension, so I don't know if I'm following everything. For example, I'm assuming that passing a bad key is caught before the zoteroLink function is called. Suggestions welcome.

Otherwise, this seems to work well enough for me. So, I'd like it to be in the actual plugin.

This is mostly just adapted from Zutilo, but it seems to be considered
the "blessed" version, so I'm keeping it for now.
@zzeitt
Copy link

zzeitt commented Sep 15, 2023

Hi @NorwegianRockCat , I met the issue about zotero link, too. The issue is discussed here: egh/zotxt-emacs#53.

I wonder how to use the function buildZoteroLink() you wrote here. Thank you.

@NorwegianRockCat
Copy link
Author

There's not much to it.

Since I figured there were others that were dependent on previous behavior, I created a new query (zoteroLink) so passing that instead of the others queries (like citekey or bibtex) will return the "new" link.

So, you can still do everything that zotxt had before, it's just a new call. I still use this from time-to-time with some custom emacs code and find it very useful.

@zzeitt
Copy link

zzeitt commented Sep 15, 2023

I created a new query (zoteroLink) so passing that instead of the others queries (like citekey or bibtex) will return the "new" link.

Could you explain more about how to pass the query? I haven't written code to interact with Zotero before. Thanks.

@egh
Copy link
Owner

egh commented Sep 16, 2023

Sorry this slipped through the cracks. I will review soon.

@NorwegianRockCat
Copy link
Author

@zzeitt: In general, Zotxt creates a little HTTP server that runs from Zotero that only accepts requests from localhost (http://127.0.0.1:23119/zotxt). This is a REST endpoint. You can then point a REST client from a web browser or use CURL to ask for things.

For example, asking for http://127.0.0.1:23119/zotxt/items should return a JSON structure with the current selected items and their keys.

So you aren't using an API from Zotero, you are using the REST API defined by the zotxt extension (the zotxt extension is using the Zotero's API). You can do a web search for "REST Client" and your browser (e.g., Firefox) to get something to help you experiment with creating your REST queries.

Hope that helps.

@zzeitt
Copy link

zzeitt commented Sep 17, 2023

Thank you sir! Your explanation is quite clear.

I happen to know a little bit about REST API or something, so I think it might not be too hard for me to experiment with the new method.

Again, thank you for your help:)

@NorwegianRockCat
Copy link
Author

@egh Any chance for a review? This extra functionality is handy, even though it the "zotero://" url conflicts with zotxt's other URL. Still, it is very useful in my workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants