OSDN Git Service

refactored
[tdcgexplorer/nimono-crawlers.git] / bin / read-upl.rb
1 #!ruby
2 # vim: fileencoding=utf-8
3 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
4 require 'scrap'
5
6 location = ARGV.shift || 'mmd'
7
8 case location
9 when 'mmd'
10   scrap = Scrap_mmd.new
11 when 'mmdfile'
12   scrap = Scrap_mmdfile.new
13 when 'mmdacc1'
14   scrap = Scrap_mmdacc1.new
15 when 'mmdacc2'
16   scrap = Scrap_mmdacc2.new
17 end
18
19 ent = "/Volumes/uploader/src/#{location}/index.html"
20 open(ent) do |f|
21   while line = f.gets
22     if scrap.match(line)
23       puts scrap.row.join("\t")
24     end
25   end
26 end