--- /dev/null
+#!ruby
+require 'nkf'
+
+def encode(str)
+ str && NKF.nkf('-Sw', str)
+end
+
+row_re = %r(<td align=center>\[<a href='(.+?)' target='_new'>(.+?)</a>\]</td><td>(.+?)</td><td align=right>(.+?)</td><td align=center>(.+?)</td><td>(.+))
+
+Dir.glob('/Volumes/uploader/src/mmdacc1/*.html') do |ent|
+ f = open(ent)
+ while line = f.gets
+ # puts line
+ if match = row_re.match(line)
+ _, href, name, comment, size, date, orig = match.to_a
+ puts [ name, encode(comment), size, date, encode(orig) ].join("\t")
+ end
+ end
+ f.close
+end
--- /dev/null
+#!ruby
+# vim: fileencoding=utf-8
+require 'nkf'
+
+def encode(str)
+ str && NKF.nkf('-Sw', str)
+end
+
+def encode_to_sjis(str)
+ str && NKF.nkf('-Ws', str)
+end
+
+row_re = %r(</td><td><a href="(.+?)">(.+?)</a></td><td>(.+?)</td><td>(.+?)</td><td>(.+?)</td><td class="down_max">(.+?)</td></tr>)
+key_re = Regexp.new(Regexp.escape(encode_to_sjis("<font color=\"#FF0000\">[パス設定] </font>")))
+
+Dir.glob('/Volumes/uploader/src/mmdacc2/*.html') do |ent|
+ f = open(ent)
+ while line = f.gets
+ # puts line
+ if match = row_re.match(line)
+ _, href, name, comment, size, date = match.to_a
+ with_key = !!key_re.match(comment)
+ if with_key
+ comment.sub!(key_re, '')
+ end
+ puts [ name, encode(comment), size, encode(date) ].join("\t")
+ end
+ end
+ f.close
+end
--- /dev/null
+#!ruby
+
+row_re = %r(<td>\[<a href="(.+?)" >(.+?)</a>\]</td><td>(.+?) <a href="(?:.+?)">(?:.+?)</a></td><td class="size">(.+?)</td><td class="date">(.+?)</td><td class="orig"><span class="orig">(.+?)</span></td>)
+key_re = Regexp.new(Regexp.escape("<strong class=\"key\">[P]</strong> "))
+
+Dir.glob('/Volumes/uploader/src/mmdfile/*.html') do |ent|
+ f = open(ent)
+ while line = f.gets
+ comment, href, name, rest = nil
+ if md = row_re.match(line)
+ _, href, name, comment, size, date, orig = md.to_a
+ with_key = !!key_re.match(comment)
+ if with_key
+ comment.sub!(key_re, '')
+ end
+ puts [ name, comment, size, date, orig ].join("\t")
+ end
+ end
+ f.close
+end
--- /dev/null
+#!ruby
+
+row_re = %r(</td><td><a href="(.+?)">(.+?)</a></td><td>(.+?)</td><td>(.+?)</td><td>(.+?)</td><td>(.+?)</td><td>(.+?)</td></tr>)
+key_re = Regexp.new(Regexp.escape("<font color=\"#FF0000\">[DLKey] </font>"))
+password_re = Regexp.new(Regexp.escape("<font color=\"#FF0000\">*</font>"))
+
+Dir.glob('/Volumes/uploader/src/mmd/*.html') do |ent|
+ f = open(ent)
+ while line = f.gets
+ if match = row_re.match(line)
+ _, href, name, comment, size, date, mime, orig = match.to_a
+ with_key = !!key_re.match(comment)
+ if with_key
+ comment.sub!(key_re, '')
+ end
+ with_password = !!password_re.match(comment)
+ if with_password
+ comment.sub!(password_re, '')
+ end
+ puts [ name, comment, size, date, mime, orig, with_key ? 'key' : '-', with_password ? 'password' : '-' ].join("\t")
+ end
+ end
+ f.close
+end
--- /dev/null
+require 'rubygems'
+gem 'zipruby'
+require 'zipruby'
+require 'nkf'
+
+def encode(str)
+ str && NKF.nkf('-Sw', str)
+end
+
+def dump_zip(path)
+ Zip::Archive.open(path) do |ar|
+ puts "# #{path}"
+
+ n = ar.num_files # number of entries
+ n.times do |i|
+ entry_name = ar.get_name(i) # get entry name from archive
+
+ # open entry
+ ar.fopen(i) do |f|
+ puts [ f.size, f.comp_size, f.mtime.strftime("%d-%m-%y %H:%M"), encode(f.name) ].join("\t")
+
+ # content = f.read # read entry content
+ end
+ end
+ end
+rescue Zip::Error => exc
+ puts "error: " + exc.message
+end
+
+Dir.glob('/Volumes/uploader/arc/mmd/*.zip') do |ent|
+ dump_zip(ent)
+ puts
+end