2143
|
1 #!/usr/bin/ruby
|
|
2 # coding: euc-jp
|
|
3
|
|
4 time = Time.now
|
|
5
|
|
6 STDERR.print "綺(cssュ)\n"
|
|
7 STDERR.print "1.蕋合(food) 2ョ綺(shop) 3.篁(other):"
|
|
8 choice = gets.chomp
|
|
9
|
|
10 STDERR.print "綺:\n"
|
|
11 sbj = gets.chomp
|
|
12
|
|
13 history = ""
|
|
14 STDERR.print "罩翫(帥茵х篋)\n"
|
|
15 while true
|
|
16 his = gets
|
|
17 if his == ".\n" || his == nil then
|
|
18 break
|
|
19 end
|
|
20 history += his
|
|
21 end
|
|
22
|
|
23 regend = ""
|
|
24 STDERR.print "篌茯(帥茵х篋)\n"
|
|
25 while true
|
|
26 reg = gets
|
|
27 if reg == ".\n" || reg == nil then
|
|
28 break
|
|
29 end
|
|
30 regend += reg
|
|
31 end
|
|
32
|
|
33 STDERR.print "\n"
|
|
34 osu = gets.chomp
|
|
35
|
|
36 STDERR.print "灸梢\n"
|
|
37 yu = gets.chomp
|
|
38
|
|
39 STDERR.print "篏\n"
|
|
40 add = gets.chomp
|
|
41
|
|
42 STDERR.print "肢援\n"
|
|
43 tel = gets.chomp
|
|
44
|
|
45 STDERR.print "≪若:"
|
|
46 before = gets.chomp
|
|
47 STDERR.print "篆絖:"
|
|
48 after = gets.chomp
|
|
49 `convert -geometry 150x100 #{before}.jpg #{after}.jpg`
|
|
50
|
|
51 open("temp.txt", "r") do |cm|
|
|
52 while x = cm.gets
|
|
53 x.gsub!("%choice%", choice)
|
|
54 x.gsub!("%time%", time.to_s)
|
|
55 x.gsub!("%sbj%", sbj)
|
|
56 x.gsub!("%after%", after)
|
|
57 x.gsub!("%history%", "<p>"+history.chomp+"</p>")
|
|
58 x.gsub!("%regend%", "<p>"+regend.chomp+"</p>")
|
|
59 x.gsub!("%osu%", osu)
|
|
60 x.gsub!("%yu%", yu)
|
|
61 x.gsub!("%add%", add)
|
|
62 x.gsub!("%tel%", tel)
|
|
63 print x
|
|
64 end
|
|
65 end
|