Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danschmidt5189/perl-worldcat-api
Perl bindings to the OCLC WorldCat API.
https://github.com/danschmidt5189/perl-worldcat-api
dzil oclc perl worldcat
Last synced: about 1 month ago
JSON representation
Perl bindings to the OCLC WorldCat API.
- Host: GitHub
- URL: https://github.com/danschmidt5189/perl-worldcat-api
- Owner: danschmidt5189
- Created: 2018-03-07T01:23:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-09T18:33:05.000Z (almost 7 years ago)
- Last Synced: 2024-10-14T11:55:09.036Z (3 months ago)
- Topics: dzil, oclc, perl, worldcat
- Language: Perl
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog
Awesome Lists containing this project
README
# NAME
WorldCat::API - Fetch MARC::Records from OCLC's WorldCat API
# VERSION
version 1.002
# SYNOPSIS
```perl
my $api = WorldCat::API->new(
institution_id => "...",
principle_id => "...",
principle_id_namespace => "...",
secret => "...",
wskey => "...",
);my $marc_record = $api->find_by_oclc_number("123") or die "Not Found!";
```# CONTRIBUTING
This project uses Dist::Zilla to set things up. You can run that directly or (more easily) by using Docker. For starters, create the build container:
```
$ docker build -t worldcatapi .
```The container contains Perl, cpanm, dzil, and all of the build dependencies. Shell into it to use it as a dev environment:
```
$ docker run --volume="$PWD:/app" --entrypoint=/bin/bash worldcatapi
```The "volume" flag syncs your local directory into the container, allowing you to develop interactively. That also means that if you build the app within the container, the build products will be reflected on your host machine:
```
$ docker run --volume="$PWD:/app" worldcatapi build
$ ls -l
…
WorldCat-API-1.002
WorldCat-API-1.002.tar.gz
…
```# TESTING
To test, you must set (staging!) API credentials in the container environment. An easy solution is to add them to a .env file at the root of the project, which you can load with Docker:
```
$ cat < .env
WORLDCAT_API_INSTITUTION_ID="..."
WORLDCAT_API_PRINCIPLE_ID="..."
WORLDCAT_API_PRINCIPLE_ID_NAMESPACE="..."
WORLDCAT_API_SECRET="..."
WORLDCAT_API_WSKEY="..."
EOF
$ docker run --volume="$PWD:/app" --env-file=.env worldcatapi test
```# AUTHOR
Daniel Schmidt
# COPYRIGHT AND LICENSE
This software is copyright (c) 2018 by Daniel Schmidt.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.