2 # download from mikumikudance
3 # http://loda.jp/mmdfile/
5 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
10 file_re = Regexp.new(Regexp.escape(file_href) + '(\d+)\\z')
11 text.scan(/href="(.+?)"/) do |href, |
12 if md = file_re.match(href)
18 uploader = SnUploader.new
19 uploader.host = "loda.jp"
20 uploader.root_path = "/mmdfile"
21 uploader.local_dir = '/Volumes/uploader/arc/mmdfile'
22 uploader.base_html = "/"
23 body = uploader.get_base
24 open('/Volumes/uploader/src/mmdfile/index.html', 'w'){ |f| f.puts body }
26 filename = id + '.zip'
27 exist = uploader.local_file_exist?(filename)
28 puts [ id, exist ? 'exist' : 'download' ].join("\t")
29 uploader.download_file_directly_id(filename)