def locked_path_pattern
case self.code
- when 'mmd'
+ when 'mmd', 'mmd3dcu'
"upload\\.cgi\\?mode=dl&file=(\\d+)"
when 'mmdfile'
"\\?mode=pass&idd=(\\d+)"
def path_pattern
case self.code
- when 'mmd'
+ when 'mmd', 'mmd3dcu'
"src/(\\w+)"
when 'mmdfile'
"\\?id=(\\d+)"
code = 'up%04d' % name.to_i
when 'mmdfile'
code = 'file%04d' % name.to_i
+ when 'mmd3dcu'
+ code = 'cu%04d' % name.to_i
end
code
end
code = 'mini%04d' % code.to_i
when 'mmdacc2'
code = code[3..-1]
+ when 'mmd3dcu'
+ code = 'cu%04d' % code[3..-1].to_i
end
[ code, extname ]
end
end
end
+class Scrap_mmd3dcu < Scrap
+ def initialize
+ @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>"))
+ @tag_list_re = Regexp.new("<span class=\"tag_list\">(.+?)</span>")
+ end
+
+ def row
+ _, href, name, comment, size, date, mime, orig = @md.to_a
+ locked = !!comment.sub!(@key_re, '')
+ comment.sub!(@tag_list_re, '\\1')
+ [ name, encode(comment), size, date, encode(orig), locked ]
+ end
+end
+
def Scrap.find_by_location_code(location_code)
case location_code
when 'mmd'
scrap = Scrap_mmdacc1.new
when 'mmdacc2'
scrap = Scrap_mmdacc2.new
+ when 'mmd3dcu'
+ scrap = Scrap_mmd3dcu.new
end
end