A Zotonic module for harvesting OAI-PMH endpoints and files.
When starting an import, an oai_pmh_import
notification will be sent for each
record. So, to process the OAI-PMH data, register one or more observers:
observe_oai_pmh_import({oai_pmh_import, Record}, Context) ->
SomeField = xmerl_xpath:string("//title", Record),
%% do more processing...
Then go ahead and either import an endpoint or a file as explained below.
To import records directly from an OAI-PMH endpoint:
oai_pmh:import("http://example.com/oai-pmh", Context).
You can supply a tuple list of URL params as second argument:
oai_pmh:import("http://example.com/oai-pmh", [{apiKey, "some_api_key"}], Context).
If you have already downloaded an XML file that contains a full OAI-PMH collection, you can import that, too:
oai_pmh:import_file("your/file.xml", Context).