2 # download from mikumikudance
3 # http://loda.jp/mmdfile/
5 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
8 def each_filename(text)
9 text.scan(%r(<a href="(.+?)" >(.+?)</a>)) do |href, name |
14 uploader = SnUploader.new
15 uploader.host = "loda.jp"
16 uploader.root_path = "/mmdfile"
17 uploader.local_dir = '/Volumes/uploader/arc/mmdfile'
18 uploader.base_html = "/?page=1"
19 body = uploader.get_base
20 open('/Volumes/uploader/src/mmdfile/1.html', 'w') { |o| o.puts body }
21 each_filename(body) do |filename|
22 exist = uploader.local_file_exist?(filename)
23 puts [ filename, exist ? 'exist' : 'download' ].join("\t")
24 uploader.download_file_directly_id(filename)