# filter/bookstore_x_custom.rb 2004/01/07 新キャッシュ用
# def bookstore_x_customは実はほぼダミーで、
# filter/bookstore_x.rb内で定義されているbookstore_x_stringの再定義が主目的
=begin
# 元祖bookstore似非風
# 元祖bookstore風
# amazon風
# 猫小屋(猫旦那さん)風
# かろかろ随想記(かろかろさん)風
# nonsense talk(notさん)風
# Alisato's 本買い日誌(有里さん)風
# 土踏まず日記(齋藤光治さん)風
=end
class Filter
def bookstore_x_custom(str, type)
# @flag_net = false #ネット書店巡回OFFなら
end
end
#=begin # 元祖bookstore似非風 http://ippo.s5.xrea.com/bookstore/recent.html
class Filter
def bookstore_x_string( isbn, infolist )
mes_str = '
'
storelist = [] #-----書店情報リスト作成-----
flag_image = nil
infolist.each{ |info| #書影書店決定
bookstore = info['bookstore_code']
flag_image = bookstore if !info['image'].nil? && (bookstore == 'amazon')
flag_image = bookstore if !info['image_local'].nil? && (bookstore == 'bk1')
}
infolist.each{ |info|
next if info.nil?
bookstore = info['bookstore_code']
new_str = ''
if flag_image == bookstore #書影確認
img_src = info['image']
img_src = info['image_local'] if bookstore == 'bk1'
height = info['image_height'].to_i != 0 ? info['image_height'].to_s : '140'
width = info['image_width'].to_i != 0 ? info['image_width'].to_s : '100'
mes_str << %Q!
!
new_str << '
絵'
elsif !info['image'].nil?
new_str << ' 絵'
end
delivery, flag = info['word_delivery'] #配送期日確認
if flag
new_str << '
'+ delivery + ''
end
if !info['review_num'].nil? || info['reviews'].to_a.size > 0 #書評確認
rev_num = info['review_num'].to_s
rev_num = info['reviews'].size.to_s if rev_num == ''
new_str << ' ' + rev_num + "評"
end
if info['bookstore_code'] == 'reviewlink'
if info['url_bibinfo'] =~ /&reviewer=.+?$/
info['url_bibinfo'] = $`.strip
end
end
if new_str.size > 0 #掠らなかった書店は無視
if flag #書店名確認
new_str = info['bookstore_name'] + new_str
else
new_str = '
' + info['bookstore_name'] + '' + new_str
end
if flag == 'over' #rl用
new_str = '
' + info['bookstore_name'] + ''
end
end
storelist << new_str if new_str.size > 0
}
mes_str << "【 " + storelist.join(" / ") + " 】\n" if storelist.size > 0
mes_str = mes_str.strip
mes_str << '
'
return mes_str
end
# def cachebibs_make ( bookstore_list = [] ) #駄目。
# @flag_rl_refer = false
# super #superが何故か効かないらしい。
# end
end
#=end
=begin # 元祖bookstore風
class Filter
def bookstore_x_string( isbn, infolist )
storelist = []
@infolist.each{ |info|
next if info.nil?
bookstore = info['bookstore_code']
storelist << %Q!#{info['bookstore_name']}! if !info['url_bibinfo'].nil?
# storelist << %Q!#{info['bookstore_name']}! #完全に真似るならこちら
}
mes_str = ''
mes_str << reviewlink_info(isbn).tag
mes_str << "【 #{storelist.join(' / ')} 】\n" if storelist.size > 0
mes_str << '
'
return mes_str
end
end
=end
=begin # amazon風 http://www14.cds.ne.jp/~not/tawagoto/200309a.html#05_t3
# 書店並びはndiary.confでBOOKSTORE_SHOP_LIST = 'amazon'指定の事
# CSS準備の事
class Filter
def bookstore_x_string( isbn, infolist )
infolist.delete(nil)
info = CacheBib.new.merge_info(infolist)
body = desc = img = ''
unless info["title"].nil?
unless info["image"].nil?
img = ""
end
desc = "
『#{info["desc"]}』" unless info["desc"].to_s.empty?
body = "#{img}「#{info["title"]}」 #{info["author"]}
サイズ: #{info["pubsize"]}cm 発行: #{info["pubdate"]} 価格: #{info["price"]}
ISBN#{info["isbn"]}#{desc}
"
end
return body
end
end
=end
=begin
# 猫小屋(猫旦那さん)風 http://aturust.com/
# CSS準備の事
class Filter
def bookstore_x_string( isbn, infolist )
#@no_image_file
img_str = ''
storelist = []
infolist.each{ |info|
next if info.nil?
bookstore = info['bookstore_code']
flag_image = (bookstore == 'bk1') ? true : false
new_str = ''
if !info['image_local'].nil? #書影確認
if flag_image
img_src = info['image_local']
height = info['image_height'].to_i != 0 ? info['image_height'].to_s : '140'
width = info['image_width'].to_i != 0 ? info['image_width'].to_s : '100'
img_str = %Q! !
else
new_str << ' 絵'
end
elsif !@no_image_file.nil?
if flag_image
img_str = @no_image_file
end
end
delivery, flag = info['word_delivery'] #配送期日確認
if flag
new_str << ' '+ delivery + ''
end
if !info['review_num'].nil? || info['reviews'].to_a.size > 0 #書評確認
rev_num = info['review_num'].to_s
rev_num = info['reviews'].size.to_s if rev_num == ''
new_str << ' ' + rev_num + "評"
end
if new_str.size > 0 #掠らなかった書店は無視
if flag #書店名確認
new_str = info['bookstore_name'] + new_str
else
new_str = '' + info['bookstore_name'] + '' + new_str
end
if flag == 'over' #rl用
new_str = '' + info['bookstore_name'] + ''
end
end
storelist << new_str if new_str.size > 0
}
infolist.delete(nil)
info = CacheBib.new.merge_info(infolist)
info["isbn"] = isbn
mes_str = ''
mes_str << '
' + info['title'] + "<\/span>\n" if !info['title'].nil?
mes_str << ''
mes_str << img_str
mes_str << reviewlink_info(isbn).tag
dat_str = []
dat_str << '
著' + info['author'] if !info['author'].nil?
dat_str << '
訳' + info['translator'] if !info['translator'].nil?
dat_str << '
ISBN' + info['isbn'] if !info['isbn'].nil?
dat_str << '
発行' + info['publisher'] if !info['publisher'].nil?
dat_str << '
発売日' + info['pubdate'] if !info['pubdate'].nil?
dat_str << '
大きさ' + info['size'] if !info['size'].nil?
dat_str << '
シリーズ' + info['series'] if !info['series'].nil?
dat_str << '
価格' + info['price'] if !info['price'].nil?
dat_str << '
説明' + info['desc'] if !info['desc'].nil?
mes_str << "
- " + storelist.join('
- ') + '
' if storelist.size > 0
if storelist.size > 0 && dat_str.size == 0
mes_str << "<\/ul>\n"
end
if storelist.size == 0 && dat_str.size > 0
mes_str << ''
end
mes_str << "- " + dat_str.join('
- ') + "<\/li><\/ul>" if dat_str.size > 0
mes_str << '
' if storelist.size + dat_str.size > 0
mes_str << '
'
mes_str << ''
return mes_str
end
end
=end
=begin
# かろかろ随想記(かろかろさん)風 http://it.sakura.ne.jp/~karo/diary/latest.htm
# CSS準備の事
class Filter
def bookstore_x_string( isbn, infolist )
#@no_image_file
mes_str = ''
storelist = []
infolist.each{ |info|
next if info.nil?
bookstore = info['bookstore_code']
flag_image = (bookstore == 'esbooks') ? true : false
new_str = ''
if !info['image'].nil?
if flag_image
height = info['image_height'].to_i != 0 ? info['image_height'].to_s : '140'
width = info['image_width'].to_i != 0 ? info['image_width'].to_s : '100'
mes_str << %Q! !
else
new_str << ' 絵'
end
elsif !@no_image_file.nil?
if flag_image
mes_str << @no_image_file
end
end
delivery, flag = info['word_delivery']
if flag
new_str << ' '+ delivery + ''
end
if !info['review_num'].nil? || info['reviews'].to_a.size > 0 #書評確認
rev_num = info['review_num'].to_s
rev_num = info['reviews'].size.to_s if rev_num == ''
new_str << ' ' + rev_num + "評"
end
if new_str.size > 0 #-----bookstore name-----
if bookstore != 'rcom'
new_str = info['bookstore_name'] + new_str
else #-----rcom custom-----
new_str = '' + info['bookstore_name'] + '' + new_str
end
if flag == 'over'
new_str = '' + info['bookstore_name'] + ''
end
end
storelist << new_str if new_str.size > 0
}
infolist.delete(nil)
info = CacheBib.new.merge_info(infolist)
info["isbn"] = isbn
mes_str << reviewlink_info(isbn).tag
mes_str << '
'
mes_str << '' + info['title'] + "<\/em>\n" if !info['title'].nil?
mes_str << "【 " + storelist.join(' / ') + " 】\n" if storelist.size > 0
mes_str << '著:' + info['author'] + "\n" if !info['author'].nil?
mes_str << '訳:' + info['translator'] + "\n" if !info['translator'].nil?
mes_str << '符:ISBN' + info['isbn'] + "\n" if !info['isbn'].nil?
mes_str << '刊:' + info['publisher'] + "\n" if !info['publisher'].nil?
mes_str << '年:' + info['pubdate'] + "\n" if !info['pubdate'].nil?
mes_str << '型:' + info['size'] + "\n" if !info['size'].nil?
mes_str << '標:' + info['series'] + "\n" if !info['series'].nil?
mes_str << '値:' + info['price'] + "\n" if !info['price'].nil?
mes_str << '紹介・説明:' + "\n" + info['desc'] + "\n" if !info['desc'].nil?
mes_str << '
'
return mes_str
end
end
=end
=begin
# nonsense talk(notさん)風 http://www14.cds.ne.jp/~not/tawagoto/
# CSS準備の事
class Filter
def bookstore_x_string( isbn, infolist )
body = desc = img = ''
storelist = []
infolist.each{ |info|
bookstore = info['bookstore_code']
if bookstore == 'amazon' # 書誌情報はamazonから取得の様子
unless info["title"].nil?
unless info["image"].nil?
img = "<\/a>"
end
body = ""
body << "#{info["author"]} 『#{info["title"]}』 (#{info["series"]})
"
body << "#{img}発行: #{info["pubdate"]} 価格: #{info["price"]} サイズ: #{info["pubsize"]}
"
body << "ISBN#{info["isbn"]}#{desc}
"
end
end
storelist << %Q!#{info['bookstore_name']}! if !info['url_bibinfo'].nil?
# storelist << %Q!#{info['bookstore_name']}! #完全に真似るならこちら
}
body << "【 #{storelist.join(' / ')} 】" if storelist.size > 0
return body
end
end
=end
=begin # Alisato's 本買い日誌(有里さん)風 http://alisato.parfait.ne.jp/diary/
# 書店並びはndiary.confでBOOKSTORE_SHOP_LIST = 'bk1 amazon yahoo'指定の事
# CSS準備の事
class Filter
def bookstore_x_string( isbn, infolist )
storelist = []
infolist.each{ |info|
next if info.nil?
bookstore = info['bookstore_code']
title = %Q!「ISBN:#{isbn}」を#{info['bookstore_name']}で検索!
storelist << %Q!#{info['bookstore_name']}! if !info['url_bibinfo'].nil?
}
infolist.delete(nil)
info = CacheBib.new.merge_info(infolist)
info['isbn'] = isbn
mes_str = "■[]#{info["author"]}『#{info["title"]}』,ISBN#{info["isbn"]}\n"
mes_str << "#{info["author"]}『#{info["title"]}』<\/span>(#{info["publisher"]}, #{info["pubdate"]}, #{info["price"]}+税, ISBN#{info["isbn"]})\n"
mes_str << '購入ガイド' + "\n"
mes_str << reviewlink_info(isbn).tag
mes_str << "ISBN#{info["isbn"]}"
mes_str << "【#{storelist.join('/')}】" if storelist.size > 0
return mes_str
end
end
=end
=begin # 土踏まず日記(齋藤光治さん)風 http://sto-2.cside7.com/tutihumaindex.html
# 書店並びはndiary.confでBOOKSTORE_SHOP_LIST = 'bk1 amazon'指定の事
# CSS準備の事
class Filter
def bookstore_x_string( isbn, infolist )
storelist = [] #-----書店情報リスト作成-----
infolist.each{ |info|
next if info.nil?
bookstore = info['bookstore_code']
title = %Q!「ISBN:#{isbn}」を#{info['bookstore_name']}で検索!
storelist << %Q![#{info['bookstore_name']}]! if !info['url_bibinfo'].nil?
# storelist << %Q![#{info['bookstore_name']}]! #完全に真似るならこちら
}
infolist.delete(nil)
info = CacheBib.new.merge_info(infolist)
info['isbn'] = isbn
info['publisher'] = '-----' if info['publisher'].nil?
info['pubdate'] = '-----' if info['pubdate'].nil?
info['price'] = '-----' if info['price'].nil?
info['size'] = '-----' if info['size'].nil?
info['isbn'] = '-----' if info['isbn'].nil?
mes_str = ''
mes_str << reviewlink_info(isbn).tag
mes_str << ''
mes_str << info['author'] if !info['author'].nil?
mes_str << " 『#{info['title']}』" if !info['title'].nil?
mes_str << ''
mes_str << storelist.join + "\n" if storelist.size > 0
mes_str << ''
mes_str << "出版社:" + info['publisher'] + ' | '
mes_str << "発行:" + info['pubdate'] + ' | '
mes_str << "価格:" + info['price'] + ' | '
mes_str << "サイズ:" + info['size'] + ' | '
mes_str << "ISBN:" + info['isbn']
mes_str << '' + "\n"
mes_str << %Q!『#{info['desc']}』! if !info['desc'].nil?
mes_str << '
'
return mes_str
end
end
=end