Pointers for implementing new feature (retrieving extra data from internet)

226 views
Skip to first unread message

Scott Howard

unread,
Oct 31, 2016, 5:56:24 PM10/31/16
to zotero-dev
I'm looking for opinions on the best strategy to implement a new feature. I want to populate fields in the "Extra" field from data on the internet.

Zotero can store info like PMID and PMCID in the "Extra" field, which are used for NIH grants:

I'd like to implement a way to populate those fields using the NIH's PMID/PMCID lookup API using the DOI:

The NIH tool takes the DOI and it returns the PMID and PMCID

Someone implemented this in mendeley by simply creating a perl script that reads from the sqlite DB then directly updates the DB:

I'd be ok with a tool that directly updated the sqlite db with the info, however, directly editing the DB in zotero is dangerous.


My question is, "what is the best strategy for implementing this feature?"
  1. Write a plugin using the javascript API? (or is this a bad idea since zotero is moving away from xulrunner? How will electron plugins be managed?)
  2. Write some tool using the web API? (but requires users to have their libraries synced with the web, and have setup/know their api keys?)
  3. Modify the source code itself to add a lookup engine that updates the "Extra" field?
  4. Something new in the "tools" menu?
  5. Anything else?
Thanks
-Scott

Brenton Wiernik

unread,
Nov 2, 2016, 1:34:53 AM11/2/16
to zotero-dev
Take a look at the code for the Zotero Google Scholar Citations plugin. It does a similar thing with the Google Scholar API.

Peter Gerdes

unread,
Mar 6, 2017, 9:41:28 AM3/6/17
to zotero-dev
There are a number of implementations of zotero web api clients in various languages.  In python pyzotero is pretty good.

For your purposes you can ignore most of the complexity involved in managing a client library.  Just ask for the list of items in your library (or in a particular collection in your library) fetch them all from the server query the NIH servers and update them back to the zotero server. 

Almost certainly someone has already written clients for the NIH so using the web api lets you leverage those while it's a pain in the ass to deal with that stuff in a firefox extension (at least imo some people probably find it easy).




On Monday, October 31, 2016 at 11:56:24 PM UTC+2, Scott Howard wrote:
I'm looking for opinions on the best strategy to implement a new feature. I want to populate fields in the "Extra" field from data on the internet.

Zotero can store info like PMID and PMCID in the "Extra" field, which are used for NIH grants:

I'd like to implement a way to populate those fields using the NIH's PMID/PMCID lookup API using the DOI:

The NIH tool takes the DOI and it returns the PMID and PMCID
Reply all
Reply to author
Forward
0 new messages