#!/usr/bin/perl -w
use ZOOM;
use MARC::Record;
use Encode;
use MARC::Batch;
$conn = new ZOOM::Connection("nbinet.ncl.edu.tw:210/innopac");
#$conn = new ZOOM::Connection("140.136.208.1:210/innopac");
print("主機:",$conn->option("serverImplementationName"),"\n");
$conn->option(preferredRecordSyntax => "usmarc");
#$rs = $conn->search_pqf('@attr 1=4 perl');
#$ss = $conn->scan('@attr 1=1003 a');
# if ($conn->errcode() != 0) {
# die("somthing went wrong: " . $conn->errmsg())
# }
# $conn->destroy();
# $rs = $conn->search_pqf('@attr 1=7 957493327X');
$rs = $conn->search_pqf('@attr 1=4 @attr 4=107 100');
my $n = $rs->size();
for my $i (1 .. $n) {
$rec = $rs->record($i-1);
# print $rec->render(); $rec->raw();
# print $rec->raw() . "\n";
# print "========================\n";
my $b = $rec->raw();
my $l =length ($b);
my $transl= '';
my $status = 0;
my $tmp ='';
for ($i=0; $i<$l; $i++) {
my $key = substr($b,$i,1);
if ($status == 0){
if (ord($key) != '27') {
$transl=$transl.$key;
}
else
{
$status = 1;
}
}
if ($status == 1){
if (ord($key)==36){ $status = 2; }
}
if ($status == 2) {
if (ord($key)==49){
$status = 3;
$count = -1 ;
}
}
if ($status == 3) {
if (ord($key) == '27' )
{ $status = 4;}
else {
if ($count == -1 ) {
$count = 0;
}
else {
$tmp=$tmp.$key;
}
}
}
if ($status == 4) {
if (ord($key) ==40) { $status = 5 ;}
}
if ($status == 5) {
if (ord($key) == 66) { $status = 6;}
}
if ($status == 6) {
$transl=$transl.decode('cccii',$tmp);
$status = 0;
$tmp='';
}
}
print $transl;
# $rec->render() => usmarc, $rec->raw() => iso2709
#print decode('cccii',$rec->raw()) , "\n";
}
星期五, 3月 09, 2007
星期三, 3月 07, 2007
星期二, 3月 06, 2007
catalog
http://140.136.208.1/search/.b1002201/.b1002201/1,1,1,B/marc~b1001204?save=b1001204/++export/1,-1,-1,B/export?ex_format=50&ex_device=43
http://140.119.115.1:1080/search/.b1799783/.b1799783/1,1,1,B/marc~b1799780?save=b1799780
http://140.119.115.1:1080/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://140.136.208.1/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://tulips.ntu.edu.tw/search/.a1/.a1/1,1,1,B/marc~b1799780?save=b1799780
http://tulips.ntu.edu.tw/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://140.136.208.1/search/.b1002201/.b1002201/1,1,1,B/marc~b1001204?save=b1001204/++export/1,-1,-1,B/export?ex_format=50&ex_device=43
http://140.119.115.1:1080/search/.b1799783/.b1799783/1,1,1,B/marc~b1799780?save=b1799780
http://140.119.115.1:1080/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://140.136.208.1/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://140.119.115.1:1080/search/.a1/.a1/1,1,1,B/marc~b1799780?save=b1799780
http://140.119.115.1:1080/search/.b1799783/.b1799783/1,1,1,B/marc~b1799780?save=b1799780
http://140.119.115.1:1080/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://140.136.208.1/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://tulips.ntu.edu.tw/search/.a1/.a1/1,1,1,B/marc~b1799780?save=b1799780
http://tulips.ntu.edu.tw/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://140.136.208.1/search/.b1002201/.b1002201/1,1,1,B/marc~b1001204?save=b1001204/++export/1,-1,-1,B/export?ex_format=50&ex_device=43
http://140.119.115.1:1080/search/.b1799783/.b1799783/1,1,1,B/marc~b1799780?save=b1799780
http://140.119.115.1:1080/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://140.136.208.1/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
http://140.119.115.1:1080/search/.a1/.a1/1,1,1,B/marc~b1799780?save=b1799780
fetch innopac
1.save tmp
http://140.119.115.1:1080/search/.a1/.a1/1,1,1,B/marc~b1799780?save=b1799780
2.export
http://140.136.208.1/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
save file
ex_format=50 => MARC
ex_format=47 => Full Display
ex_format=6 => Brief Display
ex_device=45 => local disk
ex_device=44 => e-mail
ex_device=43 => screen
ex_format=50&ex_device=44&email_addx=long_sam.tw%40yahoo.com.tw&email_subj=From+the+library+catalog
http://140.119.115.1:1080/search/.a1/.a1/1,1,1,B/marc~b1799780?save=b1799780
2.export
http://140.136.208.1/search/.a1/++export/1,-1,-1,B/export?ex_format=50&ex_device=45
save file
ex_format=50 => MARC
ex_format=47 => Full Display
ex_format=6 => Brief Display
ex_device=45 => local disk
ex_device=44 => e-mail
ex_device=43 => screen
ex_format=50&ex_device=44&email_addx=long_sam.tw%40yahoo.com.tw&email_subj=From+the+library+catalog
訂閱:
文章 (Atom)