Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/driebit/mod_ginger_oai_pmh
Zotonic module for harvesting OAI-PMH endpoints
https://github.com/driebit/mod_ginger_oai_pmh
Last synced: 2 days ago
JSON representation
Zotonic module for harvesting OAI-PMH endpoints
- Host: GitHub
- URL: https://github.com/driebit/mod_ginger_oai_pmh
- Owner: driebit
- License: mit
- Created: 2015-03-18T09:37:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-07-06T14:02:28.000Z (over 1 year ago)
- Last Synced: 2023-08-03T20:12:01.787Z (over 1 year ago)
- Language: Erlang
- Size: 10.7 KB
- Stars: 1
- Watchers: 21
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mod_ginger_oai_pmh
==================A Zotonic module for harvesting [OAI-PMH](http://www.openarchives.org/pmh/) endpoints
and files.Usage
-----### Register an observer
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:
```erlang
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.
### Import records from an endpoint
To import records directly from an OAI-PMH endpoint:
```erlang
oai_pmh:import("http://example.com/oai-pmh", Context).
```You can supply a tuple list of URL params as second argument:
```erlang
oai_pmh:import("http://example.com/oai-pmh", [{apiKey, "some_api_key"}], Context).
```### Import records from a file
If you have already downloaded an XML file that contains a full OAI-PMH
collection, you can import that, too:```erlang
oai_pmh:import_file("your/file.xml", Context).
```