diff --git a/repo.rb b/repo.rb new file mode 100755 index 0000000..f43f135 --- /dev/null +++ b/repo.rb @@ -0,0 +1,65 @@ +#!/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%", "

"+history.chomp+"

") + x.gsub!("%regend%", "

"+regend.chomp+"

") + x.gsub!("%osu%", osu) + x.gsub!("%yu%", yu) + x.gsub!("%add%", add) + x.gsub!("%tel%", tel) + print x + end +end diff --git a/temp.txt b/temp.txt new file mode 100644 index 0000000..8c28b6b --- /dev/null +++ b/temp.txt @@ -0,0 +1,24 @@ + + +%sbj% + + + + +
+

%time%

+

+

%sbj%

+

歴史

+%history% +

伝説

+%regend% +

オススメ品

+

%osu%

+

住所

+

%add%

+

電話番号
+

%tel%

+
+ +