OSDN Git Service

skip denied bowl
[tdcgexplorer/nimono-crawlers.git] / bin / load-arcs-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 Bowl.each_code_in_rss do |code|
17   number = /dl(\d+)\z/.match(code)[1].to_i
18   bowl = Bowl.new(code)
19   bowl.load
20   next if bowl.removed? || bowl.denied?
21
22   name = bowl.name
23   summary = bowl.summary
24   size = '0KB'
25   date = '01/01/01(Mon),00:00:00'
26   origname = bowl.origname
27   locked = bowl.locked?
28
29   arc = site.create_arc(name, summary, size, date, origname, locked)
30   arc.create_entries("/Volumes/uploader/arc/#{site.code}/#{name}") unless locked
31   puts
32 end