From 1b8c2dbfb474dce40548bc1cfc052017a9682a12 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 11 Dec 2008 21:30:36 -0500 Subject: harvest, better integrated into sisu [note sql module not yet updated to include topic_register, as requires recreation of all sisu db(s)] --- lib/sisu/v0/harvest_authors.rb | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v0/harvest_authors.rb') diff --git a/lib/sisu/v0/harvest_authors.rb b/lib/sisu/v0/harvest_authors.rb index 7a5e1cea..9586fcc3 100644 --- a/lib/sisu/v0/harvest_authors.rb +++ b/lib/sisu/v0/harvest_authors.rb @@ -168,38 +168,57 @@ module HARVEST_authors @env=SiSU_Env::Info_env.new @rc=Get_init.instance.yamlrc @page='sisu_manifest.html' + @alph=%W[9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] + @letter=@alph.shift + @vz=SiSU_Env::Get_init.instance.skin + end + def html_file_open @output={} @output[:html]=File.new("#{@env.path.output_md_harvest}/harvest_authors.html",'w') @output[:html_mnt]= if @opt.cmd.inspect =~/-M/ File.new("#{@env.path.pwd}/harvest_authors.html",'w') else nil end - @alph=%W[9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] - @letter=@alph.shift + end + def html_file_close + @output[:html].close + @output[:html_mnt].close if @output[:html_mnt].class == File end def html_print def html_songsheet + html_file_open html_head html_alph html_body html_tail + html_file_close end def html_head_adjust(type='') css_path=if type !~/maintenance/ '../_sisu/css/harvest.css' else 'harvest.css' end + sv=SiSU_Env::Info_version.new.get_version < SiSU Metadata Harvest - Authors + + + + + + + + +

SiSU Metadata Harvest - Authors

-

also see SiSU Metadata Harvest - Topics

+

[ HOME ] also see SiSU Metadata Harvest - Topics


WOK end @@ -222,6 +241,14 @@ WOK def html_tail a=[] a <<< + + + + + + +#{@vz.credits_sisu} WOK -- cgit v1.2.3 From f20476d31f60bd1e8c83e91379f414bdc0cfdd60 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 13 Dec 2008 14:08:19 -0500 Subject: mostly additional metadata fields additional metadata fields css minor touch help minor info touch --- lib/sisu/v0/harvest_authors.rb | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'lib/sisu/v0/harvest_authors.rb') diff --git a/lib/sisu/v0/harvest_authors.rb b/lib/sisu/v0/harvest_authors.rb index 9586fcc3..9678e4f7 100644 --- a/lib/sisu/v0/harvest_authors.rb +++ b/lib/sisu/v0/harvest_authors.rb @@ -102,16 +102,18 @@ module HARVEST_authors end def extract_harvest data,filename,idx_array=@data,@filename,@idx_array - @publication_details,@title,@subtitle,@fulltitle,@author,@author_format=nil,nil,nil,nil,nil,nil + @orig_pub,@title,@subtitle,@fulltitle,@author,@author_format=nil,nil,nil,nil,nil,nil @authors=[] rgx={} rgx[:author]=/^@(?:author|creator):\s+(.+)/ rgx[:title]=/^@title:\s+(.+)/ rgx[:subtitle]=/^@subtitle:\s+(.+)/ - rgx[:publication_details]=/^@original_publication_details:\s+(.+)/ + rgx[:date]=/^@subtitle:\s+(.+)/ + rgx[:date]=/^@date:\s+(\d{4})/ + rgx[:orig_pub]=/^@original_publication:\s+(.+)/ data.each do |para| - if para=~ rgx[:publication_details] - @publication_details=rgx[:publication_details].match(para)[1] + if para=~ rgx[:orig_pub] + @orig_pub=rgx[:orig_pub].match(para)[1] end if para=~ rgx[:title] @title=rgx[:title].match(para)[1] @@ -122,19 +124,22 @@ module HARVEST_authors if para=~ rgx[:author] @author_format=rgx[:author].match(para)[1] end - break if @title and @subtitle and @author and @publication_details + if para=~ rgx[:date] + @date=rgx[:date].match(para)[1] + end + break if @title and @subtitle and @author and @date and @orig_pub end @fulltitle=if @subtitle @title + ' - ' + @subtitle else @title end - if @title and @author_format #and @publication_details + if @title and @author_format #and @orig_pub (publication details) creator=FORMAT::Author.new(@author_format.strip).author_details @authors,@authorship=creator[:authors],creator[:authorship] file=filename.sub(/\.ss[mt]$/,'') - idx_array <<= { :filename => filename, :file => file, :publication_details => @publication_details, :title => @fulltitle, :author => creator } + idx_array <<= { :filename => filename, :file => file, :orig_pub => @orig_pub, :date => @date, :title => @fulltitle, :author => creator } else - #p "missing author field: #@filename title: #@title; author: #@author_format; idx: #@publication_details" + #p "missing author field: #@filename title: #@title; author: #@author_format; idx: #@orig_pub" end idx_array.flatten! idx_array @@ -156,7 +161,7 @@ module HARVEST_authors if @@the_idx_authors[author].class==NilClass @@the_idx_authors[author]={:md => []} end - @@the_idx_authors[author][:md] << { :filename => idx[:filename], :file => idx[:file], :author => idx[:author], :title => idx[:title] } + @@the_idx_authors[author][:md] << { :filename => idx[:filename], :file => idx[:file], :author => idx[:author], :title => idx[:title], :date => idx[:date] } end end @the_idx=@@the_idx_authors @@ -290,9 +295,9 @@ WOK @output[:html] << x a[1][:md].each do |x| if @output[:html_mnt].class == File - @output[:html_mnt] << %{

[src]  #{x[:title]}, #{x[:author][:authors_s]} -- [#{x[:file]}.sst]

} + @output[:html_mnt] << %{

[src]  #{x[:date]} #{x[:title]}, #{x[:author][:authors_s]} -- [#{x[:file]}.sst]

} end - @output[:html] << %{

#{x[:title]}, #{x[:author][:authors_s]}

} + @output[:html] << %{

#{x[:date]} #{x[:title]}, #{x[:author][:authors_s]}

} end end end -- cgit v1.2.3