view archive/blog.rb @ 3911:21b1a958ca80

新堀神楽のtitleの変更
author KITAJIMA Ryuto <c118077@roy.e.koeki-u.ac.jp>
date Fri, 02 Aug 2019 14:13:45 +0900
parents ca7dc3493900
children
line wrap: on
line source

#!/usr/bin/ruby
# coding: euc-jp

require 'date'

day = Date.today

STDERR.print "帥ゃ:"
title = gets.chomp

comment = ""
STDERR.puts "潟<潟(帥茵с障)"
while true
  com1 = gets
  if com1 == ".\n" || com1 == nil then # nilC-dуュ腟篋
    break
  end
  comment += com1
end

STDERR.print "≪若(糸<ゃ絎Return):"
photo = gets.chomp
if photo != "" then
  photo = '<img src="'+photo+'" width="640" height="480">'
end

STDERR.print "吾篋:"
writer = gets.chomp

open("template.txt", "r") do |cm|
  while x = cm.gets
    x.gsub!("%day%", day.to_s)
    x.gsub!("%title%", title)
    x.gsub!("%comment%", "<p>"+comment.chomp+"</p>")
    x.gsub!("%photo%", photo)
    x.gsub!("%writer%", writer)
    print x
  end
end

yatex.org