Skip to content
Snippets Groups Projects
Commit 3484621b authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'dev/13779-moulins-numerique-premium' into 'master'

Dev/13779 Moulins Numerique Premium
parents 126b5085 2139614a
Branches
Tags
2 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!244Master
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require('console.php');
setupOpac();
$sql = "UPDATE album SET visible = 0 WHERE url_origine LIKE '%numeriquepremium.com%';";
sqlExecute($sql);
if ($argc <= 1) {
echo "Usage: $argv[0] URL [URL...]\n";
exit;
}
array_shift($argv);
foreach ($argv as $url) {
process_url($url);
}
function process_url($url) {
file_put_contents('/tmp/marc.mrc', file_get_contents($url));
exec('yaz-marcdump /tmp/marc.mrc | grep ^073 | cut -c 11-', $output);
$sql = "UPDATE album SET visible = 1 WHERE id_origine IN (" . implode(',', $output) . ");";
sqlExecute($sql);
}
?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment