-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathht-url-doi-urn-conc.sh
executable file
·29 lines (20 loc) · 1.42 KB
/
ht-url-doi-urn-conc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/bash
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $scriptdir
source variables.conf
SERVERPREFIX="$FRONTEND/resource"
curl -s -XGET $ELASTICSEARCH/${INDEXNAME}2/journal,monograph,webpage/_search -d'{"query":{"match_all":{}},"fields":["/@id"],"size":"50000"}'|\
egrep -o "$INDEXNAME:[^\"]*">$REGAL_HOME/logs/titleObjects.txt
for i in `cat $REGAL_HOME/logs/titleObjects.txt|sort`
do
ht=`curl -s $ELASTICSEARCH/${INDEXNAME}2/_all/$i | egrep -o "hbzId\":[\[\"]{1,2}[^\"]*"|egrep -o "[A-Z]{2}[0-9]{9}"`;
doi=`curl -s $ELASTICSEARCH/${INDEXNAME}2/_all/$i | egrep -o "doi\":[\[\"]{1,2}[^\"]*"|egrep -o "10.*"|uniq`;
urn=`curl -s $ELASTICSEARCH/${INDEXNAME}2/_all/$i | egrep -o "urn\":[\[\"]{1,2}[^\"]*"|egrep -o "urn:[^\"]*"`;
if [ ${#ht} -eq 11 ]
then
echo $ht, $SERVERPREFIX/$i , $doi, $urn
#else
# Do nothing - Verbund interessiert sich nur für Objekte mit HT
#echo $i , XXXXXXXXXXX;
fi
done |sort > $REGAL_HOME/logs/pid-catalog-conc-`date +"%Y%m%d"`-all.csv