Module: Spidr
- Defined in:
- lib/spidr/page.rb,
lib/spidr/agent.rb,
lib/spidr/spidr.rb,
lib/spidr/rules.rb,
lib/spidr/events.rb,
lib/spidr/filters.rb,
lib/spidr/version.rb,
lib/spidr/sanitizers.rb,
lib/spidr/cookie_jar.rb,
lib/spidr/auth_store.rb,
lib/spidr/session_cache.rb,
lib/spidr/auth_credential.rb,
lib/spidr/actions/actions.rb,
lib/spidr/actions/exceptions/paused.rb,
lib/spidr/actions/exceptions/action.rb,
lib/spidr/actions/exceptions/skip_page.rb,
lib/spidr/actions/exceptions/skip_link.rb
Defined Under Namespace
Modules: Actions, Events, Filters, Sanitizers Classes: Agent, AuthCredential, AuthStore, CookieJar, Page, Rules, SessionCache
Constant Summary
- COMMON_PROXY_PORT = Common proxy port.
8080- DEFAULT_PROXY = Default proxy information.
{ :host => nil, :port => COMMON_PROXY_PORT, :user => nil, :password => nil }
- VERSION = Spidr version.
'0.2.2'
Class Method Summary
- + (Object) disable_proxy! Disables the proxy settings used by all newly created Agent objects.
- + (Object) host(name, options = {}, &block)
- + (Hash) proxy Proxy information used by all newly created Agent objects by default.
- + (Hash) proxy=(new_proxy) Sets the proxy information used by Agent objects.
- + (Object) site(url, options = {}, &block)
- + (Object) start_at(url, options = {}, &block)
- + (String) user_agent The User-Agent string used by all Agent objects by default.
- + (Object) user_agent=(new_agent) Sets the Spidr User-Agent string.
Class Method Details
+ (Object) disable_proxy!
Disables the proxy settings used by all newly created Agent objects.
53 54 55 56 |
# File 'lib/spidr/spidr.rb', line 53 def Spidr.disable_proxy! @@spidr_proxy = DEFAULT_PROXY return true end |
+ (Object) host(name, options = {}, &block)
88 89 90 |
# File 'lib/spidr/spidr.rb', line 88 def Spidr.host(name,={},&block) Agent.host(name,,&block) end |
+ (Hash) proxy
Proxy information used by all newly created Agent objects by default.
21 22 23 |
# File 'lib/spidr/spidr.rb', line 21 def Spidr.proxy @@spidr_proxy ||= DEFAULT_PROXY end |
+ (Hash) proxy=(new_proxy)
Sets the proxy information used by Agent objects.
46 47 48 |
# File 'lib/spidr/spidr.rb', line 46 def Spidr.proxy=(new_proxy) @@spidr_proxy = {:port => COMMON_PROXY_PORT}.merge(new_proxy) end |
+ (Object) site(url, options = {}, &block)
95 96 97 |
# File 'lib/spidr/spidr.rb', line 95 def Spidr.site(url,={},&block) Agent.site(url,,&block) end |
+ (Object) start_at(url, options = {}, &block)
81 82 83 |
# File 'lib/spidr/spidr.rb', line 81 def Spidr.start_at(url,={},&block) Agent.start_at(url,,&block) end |
+ (String) user_agent
The User-Agent string used by all Agent objects by default.
64 65 66 |
# File 'lib/spidr/spidr.rb', line 64 def Spidr.user_agent @@spidr_user_agent ||= nil end |
+ (Object) user_agent=(new_agent)
Sets the Spidr User-Agent string.
74 75 76 |
# File 'lib/spidr/spidr.rb', line 74 def Spidr.user_agent=(new_agent) @@spidr_user_agent = new_agent end |