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

[HotFix] HAL: Hotfix for identification failures #3077

Merged
merged 2 commits into from
Jul 12, 2023

Conversation

zoe-translates
Copy link
Collaborator

@zoe-translates zoe-translates commented Jul 12, 2023

The HAL translator did not work at all with the new HAL site at a different domain.

  • Update target regex for the new domain hal.science
  • Update the element selector for the content-type label
  • Do some cleaning with raw content-type label text; update some labels
  • Fix a large number of ESLint errors

Resolves #3041 (Edit: also resolves #3045)

The HAL translator did not work at all with the new HAL site at a
different domain.

- Update target regex for the new domain `hal.science`
- Update the element selector for the content-type label
- Do some cleaning with raw content-type label text; update some labels
- Fix a large number of ESLint errors

Resolves zotero#3041
@zoe-translates
Copy link
Collaborator Author

zoe-translates commented Jul 12, 2023

In the long run, we should probably just use the API; it supports OAI https://api.archives-ouvertes.fr/docs/oai Example: https://api.archives-ouvertes.fr/oai/hal/?verb=GetRecord&metadataPrefix=oai_dc&identifier=thouret%3Ahal-00328427

Meanwhile, this is a fix for the translator not being run at all, and possibly some wrong icon types displayed in Connector. (And superficial fixes for ESLint failures).

The Library Catalog seems to have changed from "HAL archives ouvertes" to "HAL science ouverte".

- Update selector for abstract (it now has a class list with more class
  names so the previous XPath failed).
- Update the selector for PDF link.
- Cosmetic fix: further fixes to the type identification (affecting the
  Connector icon, not the actual item's metadata).
@@ -90,34 +98,33 @@ function doWeb(doc, url) {
for (var i in items) {
articles.push(i);
}
Zotero.Utilities.processDocuments(articles, scrape)
Zotero.Utilities.processDocuments(articles, scrape);
return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't actually check the return value of the selectItems callback (anymore?), so the consistent-return fix here is just to change the first return true; to return;.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right about the callback return value being discarded. But because this is now already merged, I'm going to focus on substantive improvements next (for example, asyncify, use OAI for metadata, with speedup of saving multiple, etc.)

@dstillman dstillman merged commit 28f344c into zotero:master Jul 12, 2023
@zoe-translates zoe-translates deleted the HAL-hotfixes branch July 12, 2023 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

City not imported when importing an oral communication from HAL Importing Reports from HAL
2 participants