OAI-PMH Harvester: Support for API-Keys?

I wonder if the OAI-PMH-Harvester Plugin supports OAI-PMH-Provider with restricted access?

For example, to access the repository of the Brooklyn Museum (http://www.brooklynmuseum.org/opencollection/api/docs/oai) one has to register for an individual API key.

If I'm following you correctly, it should just be a matter of getting the key from the providing site and making it part of the URL you harvest from.

If, on the other hand, you are talking about Omeka's OAI-PMH Provider plugin restricting with api keys, I don't think we have anything in place for that.

> it should just be a matter of getting
> the key from the providing site and
> making it part of the URL you harvest from

Yes. I do have a key, but there seems to be no way to add that key to the URL in the OAI-PMH-Harvester Plugin. The Brooklyn Museum says that you need to provide the key like this:
http://www.brooklynmuseum.org/opencollection/api/oai.pmh.php?api-key=[Your API Key]

But the OAI-PMH-Harvester Plugin needs the base URL of the service like this:
http://www.brooklynmuseum.org/opencollection/api/oai.pmh.php

So I guess the functionality of the plugin has to be extended to support custom (static) URL params. Or am I wrong?

If the only way the Brooklyn Museum's endpoint will work is with an extra URL parameter like that, then yes, you're right.

I think the plugin would need at least a minor change to account for the query already being present in the base URL (probably just switching a ? to a &).

> I think the plugin would need at least
> a minor change to account for the query
> already being present in the base URL
> (probably just switching a ? to a &).

Good idea. I've modified the plugin that way and now it works. Here is what I did:

OaipmhHarvester\libraries\OaipmhHarvester\Xml.php
Line 61-64
Changed this ...

private function getRequestUrl($baseUrl, $requestArguments)
{
return $baseUrl . '?' . http_build_query($requestArguments);
}

... to that ...

private function getRequestUrl($baseUrl, $requestArguments)
{
$sep = strpos($baseUrl,'?') ? '&' : '?';
return $baseUrl . $sep . http_build_query($requestArguments);
}