Skip to content

Instantly share code, notes, and snippets.

@dmj
Created May 18, 2021 10:32
Show Gist options
  • Save dmj/5266a87f0216d56960206a339c0965e1 to your computer and use it in GitHub Desktop.
Save dmj/5266a87f0216d56960206a339c0965e1 to your computer and use it in GitHub Desktop.
{
"require": {
"hab/picarecord": "^1.1",
"hab/picareader": "^1.2"
}
}
<?php
use HAB\Pica\Record\Record;
use HAB\Pica\Reader\PicaNormReader;
require_once __DIR__ . '/vendor/autoload.php';
$ppn = '1018291776';
$psiTemplate = 'https://kataloge.uni-hamburg.de/DB=1/PLAIN=Y/CHARSET=UTF-8/PLAINTTLCHARSET=UTF-8/PPN?PPN=%s';
$psiUrl = sprintf($psiTemplate, $ppn);
$content = file_get_contents($psiUrl);
$reader = new PicaNormReader();
$reader->open($content);
$record = $reader->read();
$fields = $record->getFields('201@');
print_r($fields);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment