Sha256: 5b150e3991d089d8b478ce43c38022594806e6b35e92e8ab9ae15c27c8f2d206

Contents?: true

Size: 523 Bytes

Versions: 5

Compression:

Stored size: 523 Bytes

Contents

require 'typhoeus'

module Iconoclasm
  module Downloader

    @@user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
    
    def self.user_agent=(agent)
      @@user_agent = agent
    end
    
    def self.user_agent
      @@user_agent
    end
    
    def user_agent
      @@user_agent
    end
    
    def get(url)
      Typhoeus::Request.get(url, :user_agent => user_agent, :follow_location => true)
    end
    
    def head(url)
      Typhoeus::Request.head(url, :user_agent => user_agent)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
iconoclasm-1.0.5 lib/iconoclasm/downloader.rb
iconoclasm-1.0.4 lib/iconoclasm/downloader.rb
iconoclasm-1.0.3 lib/iconoclasm/downloader.rb
iconoclasm-1.0.2 lib/iconoclasm/downloader.rb
iconoclasm-1.0.1 lib/iconoclasm/downloader.rb