pointers for first-time translator creation

Hi all.
I have been tasked with managing (and creating) translators for web articles of various sites. I'm in a standalone system, so the documents are served internally. I have been studying the translators that we already have, and I read the coding translators page on this website. I think I largely understand the process.

Zotero calls on the detect and do functions to first determine if it has the best translator for the job and then to proceed with a scrape for the required information.
The translator creates an object of the target document type, and as it acquires the relevant metadata, it attaches the metadata to the object in an attribute/value format.
When all the metadata is gathered, the object is complete.

I'm left with a few questions.
1. What is the endpoint of the translator work where it hands the result back to the Zotero app? Is it when it says objWhatever.complete, when flow returns to the do function and it reaches the end of the function?
2. Where is the requisite metadata determination made? Is that done in the Zotero app somewhere? For example, Title, URL, PublishDate, page number(s), volume, issue, etc. seem like good metadata to gather for a journal article, but where is this laid out/set up in Zotero, and is it something I can change (add extra fields, rename fields, etc.)?
3. I followed most of the process where Javascript is involved, but I am not familiar with using selectors, xpath, and node to retrieve data. Is there a very good tutorial for this somewhere? I have been through the W3 School tutorials on some of it, but I haven't used it. In the past, I would perform this kind of work by parsing the HTML for the tags corresponding to the needed data values and get it that way, or use document.GetElementById() and get it that way.

What I really could use (in addition to what's available on this site) is a tutorial or demonstration where somebody has built a translator either from scratch or from the template available in Scaffold, in good detail. Does anybody know of one? I checked YouTube didn't find what I was looking for.

I"m at like 75% in terms of creating a new translator, but I wouldn't attempt it from where I am now.

Thanks in advance for any information you can provide.




Sign In or Register to comment.