-
Notifications
You must be signed in to change notification settings - Fork 756
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 Translator for TinRead OPACs #3124
Comments
@adam3smith I've taken a look at this, and the MARC, while easily accessible, is tag-structured in HTML in a way that that makes it difficult to write a ` 100
Since it just uses line breaks and the data isn't structured in rows, I can't figure out how to easily select it, without resorting to writing loops. On the other hand, the "Etichetat" view (first tab on the catalog page) is nicely structured in a table, but isn't MARC, so would require writing more lines of code and not taking advantage of the MARC translator. Which approach do you recommend? |
Maybe something like: let root = doc.querySelector('#marc li');
for (let child of root.childNodes) {
if (child.nodeType === Node.ELEMENT_NODE && child.tagName == 'B') {
if (child.textContent.startsWith('$') {
let subtag = child.textContent;
// do something with the subtag
}
else {
let tag = child.textContent;
// do something with the tag
}
}
else {
let content = child.textContent;
// this is the content of the last subtag - do something with it
}
} |
It looks like the MARC can actually be exported in the MARCXML format by clicking the Maybe I'll try writing a translator to grab the XML from the export button and then defer to the MARCXML translator? |
Sure enough, the following works for me:
I'll see if I can get |
Have a look at the template functions in Scaffold/Translator Editor. New translators should use async functions and the async |
Got it! Went ahead and opened a PR. Right now all of my test cases pass (though they can be kind of hit-or-miss due to a race condition), and linter tests also pass. Let me know if there's anything else I need to fix here! The fact that these functions are |
Fixed by #3223 |
Requested here: https://forums.zotero.org/discussion/107275/support-for-the-tinread-library#latest
Has easily accessible MARC, so shouldn't be heard. Examples:
https://opac.biblioteca.ase.ro/opac/bibliographic_view/144193?pn=opac%2FSearch&q=gheorghe+carstea#level=all&location=0&ob=asc&q=gheorghe+carstea&sb=relevance&start=0&view=CONTENT
https://tinread.biblioteca.ct.ro/opac/bibliographic_view/238969?pn=opac/Search&q=educatie+fizica#level=all&location=0&ob=asc&q=educatie+fizica&sb=relevance&start=0&view=CONTENT
https://catalog.ucv.ro/opac/bibliographic_view/68938?pn=opac/Search&q=educatie+fizica#level=all&location=0&ob=asc&q=educatie+fizica&sb=relevance&start=0&view=CONTENT
http://tinread.bjbn.ro:8080/opac/bibliographic_view/36090?pn=opac/Search&q=metodica+fotbal#level=all&location=0&ob=asc&q=metodica+fotbal&sb=relevance&start=0&view=CONTENT
https://tinread.upit.ro/opac/bibliographic_view/37902?pn=opac/Search&q=metodica+educatie+fizica#level=all&location=0&ob=asc&q=metodica+educatie+fizica&sb=relevance&start=0&view=CONTENT
The text was updated successfully, but these errors were encountered: