OSDN Git Service

deleted Bowl. renamed Bowl20110904 to Bowl.
[tdcgexplorer/nimono-crawlers.git] / bin / scrap-bowl.rb
1 #!ruby
2 # encoding: utf-8
3 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
4 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../app/models')
5 require 'connection'
6 require 'site'
7 require 'arc'
8 require 'pmd'
9 require 'vmd'
10 require 'x'
11 require 'thumb'
12 require 'bowl'
13
14 site = Site.find('mmdbowl')
15
16 for number in 745..1045
17   code = "dl#{number}"
18   bowl = Bowl.new(code)
19   unless File.exist?(bowl.src_path)
20     puts "PASS: src #{code} not found"
21     next
22   end
23   bowl.load
24   next if bowl.removed? || bowl.denied?
25
26   name = bowl.name
27   summary = bowl.summary
28   size = '0KB'
29   date = '01/01/01(Mon),00:00:00'
30   origname = bowl.origname
31   locked = bowl.locked?
32
33   arc = site.create_arc(name, summary, size, date, origname, locked)
34   unless File.exist?(bowl.arc_path)
35     puts "PASS: arc #{code} not found"
36     next
37   end
38   bowl.load
39   arc.create_entries("/Volumes/uploader/arc/#{site.code}/#{name}") unless locked
40   puts
41 end