星期五, 3月 09, 2007

zoom.pl nbinet.ncl.edu.tw marc

#!/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月 07, 2007

cccii convert utf8

#!/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');
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";
}

new project copy trad-chinese zh_TW marc

new koha project
mirror all http://nbinet.ncl.edu.tw/ marcdata to koha breedings
about 5 million records,these marcdatas have to decode cccii to
utf8.

use perl script & modules
innopac use " { "cccii code " } "

innopac cccii

連接 INNOPAC 圖書館的CCCII編碼方式已經解決了, 他們是用 "{}"
來把每一個字括起來

eg.

字1,字2 = { + 字1 + } + { + 字2 + } = {212321}{212324}

星期二, 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

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

catalog spider

create catalog spider
fetch nbinet cmarc for unicode
import iso2709 koha breedings

星期日, 3月 04, 2007

unimarc print

#!/usr/bin/perl -w

use MARC::Batch;

my $batch = MARC::Batch->new('USMARC','/home/laxendion/tools/iso/new1.dat');
while( my $record = $batch->next()) {

my @fields = $record->fields();
foreach my $field (@fields) {
print
$field->tag(), " ",
defined $field->indicator(1) ? $field->indicator(1) : "",
defined $field->indicator(2) ? $field->indicator(2) : "",
" ", $field->as_string, " \n";
}
}

unimarc 681 convert 805

#!/usr/bin/perl -w

use MARC::Record;
use MARC::Batch;

my $batch = MARC::Batch->new('USMARC','/home/laxendion/tools/iso/marc');
open(OUT,'> new1.dat') or die $!;
$batch->strict_off();
## read in each record.
while ( my $record = $batch->next() ) {
##fetch 852h
#my $good = $record->field('681');
#my $goodsub = $good->subfield('a');
#$record->subfield(681,"a");
## find the tag after 900.
my $class = $record->field('681')->subfield("a");
my $before;
foreach ($record->fields()) {
$before = $_;
last if $_->tag() > 800;
}

## create the 942 field.
my $new = MARC::Field->new('805','','','d' => $class);
## insert our 942 field after the $before.
$record->insert_fields_before($before,$new);
print $class . "\n";
## and print out the new record.
print OUT $record->as_usmarc();

}

An example perl script to move 852h >dewey< to 942k dewey default for Koha2.2

http://wiki.koha.org/doku.php?id=herea

## Example U2 this is a modified script with thanks to the MARC::Record
## designers and documentation group

use MARC::Batch;
my $batch = MARC::Batch->new('USMARC','/home/mike1/lib4per/MICRO.new');
open(OUT,'>new1.dat') or die $!;
$batch->strict_off();
## read in each record.
while ( my $record = $batch->next() ) {
##fetch 852h
my $good = $record->field('852');
my $goodsub = $good->subfield('h');
## find the tag after 900.
my $before;
foreach ($record->fields()) {
$before = $_;
last if $_->tag() > 900;
}

## create the 942 field.
my $new = MARC::Field->new('942','','',k=>$goodsub);

## insert our 942 field after the $before.
$record->insert_fields_before($before,$new);

## and print out the new record.
print OUT $record->as_usmarc();

}

星期六, 3月 03, 2007

koha 3.0 opac for zebra

1.install koha 2.2.5 & koha 2.2.6 ...
2.cp nkes Koha => your Koha
and run rel_3_0/koha/updater/updater/updatedatabase

3.setup zebra
http://wiki.koha.org/doku.php?id=installingzebraplugin226
http://wiki.koha.org/doku.php?id=faqzebra
zebra.cfg
http://kohaa.blogspot.com/2007/02/zebracfg.html

PS. cvs dev_week
cp dev_week/koha/zebraplugin/zebradb/biblios/tab/* to your zebra/etc/*
4.cvs koha rel_3_0
cp /opac/*.pl -> /opac/cgi-bin/
http://kohataiwan.googlegroups.com/web/prog_opac_zh_TW.po
http://koha.wikispaces.com/chinesenization

5.export nkes marc iso2709

6.Must have zebra.cfg config directory(zebra-XXX.cfg
use -c parameter)

copy zebrapl
zebra init
zebra create biblios(databaename see your koha.xml)
zebra -g iso2709 -d biblios(databaename see your koha.xml) update
iso2709.marc(marc data) -n
zebra -f /etc/koha.xml

koha.xml(see rel_3_0 /misc/koha.xml)

7.modify koha-httpd.conf
opac
chanage SetEnv KOHA_CONF /etc/koha.xml
and restart apache
--------------------------------------------------------------------
chanage systempreferences
opacthemes => prog
lang =>zh_TW
opacstylesheet => /opac-tmpl/prog/zh_TW/includes/opac.css
marcflavour => unimarc check your marc type

PS.MARCXML /misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl
you use unimarc must modify scipt,marc21 don't modify
=> marcxml parser problem
see http://www.indexdata.com/zebra/doc/

星期三, 2月 28, 2007

modify zebra isbn

marc_subfield_table.sql

星期一, 2月 26, 2007

發自博客來網路書店

這個訊息是發自博客來網路書店,
告知您策略聯盟的審核已經通過!

【基本資料】
申請日期:2007-02-17 09:18:00
申請帳號:laxendion
網站名稱:南投縣國姓鄉南港國小圖書館
網  址:http://koha.nkes.ntct.edu.tw
網站描述:南投縣國姓鄉南港國小圖書館


【 合作內容】
合約日期:2007/02/26-2008/02/26
(合約到期15天前,系統會發信詢問您是否續約)
回饋分類:無仲介金行銷引薦
回饋金%:


 



==========================
如有任何問題,歡迎來信詢問
ap@books.com.tw
博客來網路書店 敬上
==========================  

星期六, 2月 24, 2007

koha3.0

perl libxml

[Sat Feb 17 11:21:53 2007] [error] [client 127.0.0.1] Start tag expected, '<' not found at /usr/local/lib/perl/5.8.7/XML/LibXML/SAX.pm line 64
[Sat Feb 17 11:21:53 2007] [error] [client 127.0.0.1] at /usr/local/share/perl/5.8.7/XML/Simple.pm line 291

/etc/koha-httpd.conf
SetEnv KOHA_CONF "/etc/koha.xml"

星期五, 2月 16, 2007

zebra command

1. zebraidx init
2. zebraidx create database
3. zebraidx -g iso2709 -d databae update /path/to/marc -n
4. zebraidx commit
5. zebrasrv @:2100

nkes

[nkes]Record type: USmarc
00691cam 2200229 4500
010 0 $a 957-754-154-2 $b 精裝
090 $9 1019 $a 1019
100 $a 20020412d1995 m y0chiy09 e.
101 0 $a chi
102 $a TW
105 $a y z 000fd.
200 1 $a 木魚石 $e 嘉慶皇帝傳奇 $f 林鐵均著.
205 $a 初版.
210 $a 臺北市 $c 國際村出版 $a 板橋市 $c 錦德發行 $d 1995[民84]
215 0 $a 217面 $d 22公分.
225 2 $a 清帝傳奇 $v 11.
606 $a 中國
700 1 $a 李
801 $a TW $b nges $g CCR $m 4
805 $a nges $d 627 $e 3024 $y v.7 $t CCL $v 增訂七版
990 $a BOOK
995 $b nges $c nges $e 中文書庫 $f A01139 $j A01139 $k 627 3024 v.7 $m 20060624 $o 0 $9 1313
--------------------------------------------------------------------------

zebra cfg

http://lists.gnu.org/archive/html/koha-devel/2005-08/msg00057.html

http://www.unt.edu/wmoen/Z3950/GIZMO/section3.htm


http://lists.indexdata.dk/pipermail/zebralist/2005-June/000800.html