leverageing zotero API for a lucid reader firefox plugin

32 views
Skip to first unread message

Andrew Micallef

unread,
Sep 10, 2016, 5:23:27 AM9/10/16
to zotero-dev
Hi there,

I'm writing a browser extension for Firefox with the intent of cleaning up the text of journals that still use what I think are nasty inline citation styles. The inline (:name:, :date:) style is a common occurrence in the neuroscience journals I read, I think it distracts from the flow of the arguments.

For that reason I have made a simple prototype extension which uses a regex pattern to attempt to remove (:name:, :date:)'s from the body text (anything under the <p> grouping in HTML).

The current build is very limited, and only worked on one site. While thinking about nasty heuristics to make my extension better I remembered a couple of features that zotero supports which I would really like to leverage.

I'm listing them in order that my extension would require them:

Zotero features I want to leverage:
0. [totally optional and not strictly necessary] identify web pages that contain academic writing
1. query the zotero style repository with the name of the journal of the currently selected tab
             (this is why the previous feature would be nice)
2. If a csl file is found in the repository, render the inline citation into a regex pattern (if multiple are returned allow the user to pick the best match)


The reason I'm posting here is that I am but a humble biologist with a passing knowledge of how to script. If anyone with an understanding of the zotero API could help me out, even if that is as simple as pointing me to the right resources I would be very grateful. In addition, if you would like to see the extension I am working on it can be found here: https://github.com/AndrewMicallef/clean-read/
It is very rudimentary at the moment, but hopefully that will change.

Regards

Andrew


Sebastian Karcher

unread,
Sep 11, 2016, 12:16:57 PM9/11/16
to zoter...@googlegroups.com
Just conceptually, one problem is that Zotero doesn't, on most academic
journals, detect the journal title on browsing: the detectWeb function
just detects the relevant translator and for most journals that's not
specific to the journal but to the publisher (Wiley, Elsevier) or even
the CMS they're using (Atypon, Silverchair, Highwire). So you'd need to
actually run doWeb on all pages the user accesses and then parse the
result for the journal title, which will have significant performance
effects so I'd council against that.

As for the style repository, I don't believe zotero.org/styles has an
open API, though you could certainly just use the webpage version for
the search or build your own super basic API based off a clone of the
CSL github.
> --
> You received this message because you are subscribed to the Google
> Groups "zotero-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to zotero-dev+...@googlegroups.com
> <mailto:zotero-dev+...@googlegroups.com>.
> To post to this group, send email to zoter...@googlegroups.com
> <mailto:zoter...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/zotero-dev.
> For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages