diff --git a/crawler/crawler.rb b/crawler/crawler.rb index 303485e9..880939ea 100644 --- a/crawler/crawler.rb +++ b/crawler/crawler.rb @@ -27,8 +27,12 @@ def get type, obj alias_method :set, :get def crawl type + count = ZendeskAPI::CLIENT.send(type.plural).count + i = 0 ZendeskAPI::CLIENT.send(type.plural).all do |obj| set type, obj + puts "#{type.plural.capitalize}: #{i += 1}/#{count}" + STDOUT.flush end end diff --git a/crawler/item.rb b/crawler/item.rb index d4d9d17f..993f1f3f 100644 --- a/crawler/item.rb +++ b/crawler/item.rb @@ -41,11 +41,6 @@ def initialize crawler, obj # Or object id, see fetch @crawler = crawler @zendesk_obj = fetch(obj) @data = build - if @zendesk_obj.nil? - puts "Not-existing object #{self.class.plural}:#{obj}" - else - puts "New #{self.class.plural}:#{@zendesk_obj.id}" - end end def build