#!/usr/bin/ruby
# coding: euc-jp
time = Time.now
STDERR.print "取材した店(css名入力)\n"
STDERR.print "1.食べ物(food) 2日用品店(shop) 3.その他(other):"
choice = gets.chomp
STDERR.print "店の名前:\n"
sbj = gets.chomp
history = ""
STDERR.print "歴史(ピリオドのみの行で終了)\n"
while true
his = gets
if his == ".\n" || his == nil then
break
end
history += his
end
regend = ""
STDERR.print "伝説(ピリオドのみの行で終了)\n"
while true
reg = gets
if reg == ".\n" || reg == nil then
break
end
regend += reg
end
STDERR.print "おすすめ品\n"
osu = gets.chomp
STDERR.print "郵便番号\n"
yu = gets.chomp
STDERR.print "住所\n"
add = gets.chomp
STDERR.print "電話番号\n"
tel = gets.chomp
STDERR.print "写真をアップロード:"
before = gets.chomp
STDERR.print "保存名:"
after = gets.chomp
`convert -geometry 150x100 #{before}.jpg #{after}.jpg`
open("temp.txt", "r") do |cm|
while x = cm.gets
x.gsub!("%choice%", choice)
x.gsub!("%time%", time.to_s)
x.gsub!("%sbj%", sbj)
x.gsub!("%after%", after)
x.gsub!("%history%", "<p>"+history.chomp+"</p>")
x.gsub!("%regend%", "<p>"+regend.chomp+"</p>")
x.gsub!("%osu%", osu)
x.gsub!("%yu%", yu)
x.gsub!("%add%", add)
x.gsub!("%tel%", tel)
print x
end
end