Skip to content
boooz edited this page May 17, 2012 · 1 revision

Setting a configuration

You can set Skyscraper configuration in two ways:

  • As static method call
>> Skyscraper.config.limit = 10
  • As class method call
class Sample
  include Skyscraper
  settings limit: 10, skip_on_error: false
end

Configuration options

Available only for included Skyscraper class:

  • delay: { sleep: 0, after: 1 } Takes an Fixnum number with delay in seconds or hash like this { sleep: 1, after: 1 }, this means Skyscraper will sleep 1 second after each page is fetched.

  • limit: nil Limit of pages which will be fetched by one #fetch call, default: nil

  • noise_errors: true If true Skyscraper will print notice if any error occured

  • skip_on_error: true Skyscraper will continue fetching pages even if some error occured - for example - page not found.

Available not only for included class:

  • download_path: "/tmp/skyscraper/:sequence/:file_name" - default download path
  • encoding: "utf-8" - default encoding

Clone this wiki locally