diff --git a/_data/facilities.yml b/_data/facilities.yml index f0c4da33aca2f73c6daea8acbd08cf26b2ae1417..ec97dc1bb3a73f2de0cad43b3b4585689b6a246a 100644 --- a/_data/facilities.yml +++ b/_data/facilities.yml @@ -528,10 +528,12 @@ link: https://doi.psi.ch/ oai-pmh-endpoint: link: https://doi.psi.ch/oaipmh/oai - status: Error + status: Active last-check: 2025-01-02 adminAddress: - carlo.minotti@psi.ch + items: + count: 0 pan-search-api: link: https://dacat.psi.ch/panosc-api/ status: Active diff --git a/scripts/update_oai-pmh.rb b/scripts/update_oai-pmh.rb index 15a073818e115d86582dfe847d03342d25794065..9bfd0006740fc3d5d2d0d796cfb063541df52d12 100644 --- a/scripts/update_oai-pmh.rb +++ b/scripts/update_oai-pmh.rb @@ -20,7 +20,10 @@ class OaiPmhClient headers 'User-Agent' => 'LEAPS-WG3-client/0.1' def initialize(oai_pmh_endpoint, from_id=nil) - self.class.base_uri oai_pmh_endpoint + # WORK_AROUND: self.class.base_uri is normalised by adding a final + # slash if it's missing. This is wrong, because some endpoints + # (legitimately) require there not to be a final slash. + @base_uri = oai_pmh_endpoint self.class.headers "From" => from_id if from_id # WORK_AROUND: The connection adapter is persistent across multiple @@ -38,17 +41,17 @@ class OaiPmhClient end def identify() - response = self.class.get("?verb=Identify") + response = self.class.get(@base_uri + "?verb=Identify") handle_response("Identify", response) end def list_sets() - response = self.class.get("?verb=ListSets") + response = self.class.get(@base_uri + "?verb=ListSets") handle_response("ListSets", response) end def list_metadata_formats() - response = self.class.get("?verb=ListMetadataFormats") + response = self.class.get(@base_uri + "?verb=ListMetadataFormats") handle_response("ListMetadataFormats", response) end @@ -74,7 +77,7 @@ class OaiPmhClient attempts += 1 starting = Process.clock_gettime(Process::CLOCK_MONOTONIC) - response = self.class.get("?verb=ListIdentifiers&" + arg) + response = self.class.get(@base_uri + "?verb=ListIdentifiers&" + arg) ending = Process.clock_gettime(Process::CLOCK_MONOTONIC) $stats.accept(ending - starting)