def execute()
time_started = Time.now.utc
date_time_format = DateTimeFormat.new()
logger = Logger.new([$stderr, File.new('log.txt', 'w')])
logger.log '現在の統計ページをもとにリソースファイルのlanguage要素を出力'
logger.log '開始しました。 ' + date_time_format.format(time_started)
config = Config.new()
current_page_file_name = 'current-page.txt'
resource = Resource.new(logger)
bot = WikiBot.new(config)
bot.login
current_revision_text = bot.current_revision_text(config.target_statistics_page)
bot.logout
output_file_name = 'resource-languages.xml'
logger.log '出力ファイル: ' + output_file_name
output = File.new(output_file_name, 'w')
WikiTable.new(current_revision_text, resource, logger).rows.each do |row|
output.puts('<language><code>' + row.code + '</code>' +
'<description>' + row.description + '</description>' +
'<articleOfWiki>' + row.article_of_wiki + '</articleOfWiki>' +
'<englishDescription>' + row.english_description + '</englishDescription>' +
'<score>' + row.score + '</score></language>')
output.flush
end
output.close
time_ended = Time.now.utc
logger.log '終了しました。 ' + date_time_format.format(time_ended)
logger.log '要した時間: ' + (time_ended - time_started).to_s + ' 秒'
end