Module: Iconoclasm::Downloader

Included in:
Favicon
Defined in:
lib/iconoclasm/downloader.rb

Constant Summary collapse

@@user_agent =
'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.user_agentObject



12
13
14
# File 'lib/iconoclasm/downloader.rb', line 12

def self.user_agent
  @@user_agent
end

.user_agent=(agent) ⇒ Object



8
9
10
# File 'lib/iconoclasm/downloader.rb', line 8

def self.user_agent=(agent)
  @@user_agent = agent
end

Instance Method Details

#get(url) ⇒ Object



20
21
22
# File 'lib/iconoclasm/downloader.rb', line 20

def get(url)
  Typhoeus::Request.get(url, :user_agent => user_agent, :follow_location => true, :timeout => 1000)
end

#head(url) ⇒ Object



24
25
26
# File 'lib/iconoclasm/downloader.rb', line 24

def head(url)
  Typhoeus::Request.head(url, :user_agent => user_agent, :timeout => 1000)
end

#user_agentObject



16
17
18
# File 'lib/iconoclasm/downloader.rb', line 16

def user_agent
  @@user_agent
end