Module: Spidr
- Defined in:
- lib/spidr/body.rb,
lib/spidr/page.rb,
lib/spidr/agent.rb,
lib/spidr/links.rb,
lib/spidr/rules.rb,
lib/spidr/spidr.rb,
lib/spidr/events.rb,
lib/spidr/filters.rb,
lib/spidr/headers.rb,
lib/spidr/version.rb,
lib/spidr/auth_store.rb,
lib/spidr/cookie_jar.rb,
lib/spidr/sanitizers.rb,
lib/spidr/session_cache.rb,
lib/spidr/actions/actions.rb,
lib/spidr/auth_credential.rb,
lib/spidr/actions/exceptions/action.rb,
lib/spidr/actions/exceptions/paused.rb,
lib/spidr/actions/exceptions/skip_link.rb,
lib/spidr/actions/exceptions/skip_page.rb
Defined Under Namespace
Modules: Actions, Body, Events, Filters, Headers, Links, Sanitizers Classes: Agent, AuthCredential, AuthStore, CookieJar, Page, Rules, SessionCache
Constant Summary collapse
- 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
'1.0.0'
Class Method Summary collapse
-
.disable_proxy! ⇒ Object
Disables the proxy settings used by all newly created Agent objects.
- .host(name, options = {}, &block) ⇒ Object
-
.proxy ⇒ Hash
Proxy information used by all newly created Agent objects by default.
-
.proxy=(new_proxy) ⇒ Hash
Sets the proxy information used by Agent objects.
- .site(url, options = {}, &block) ⇒ Object
-
.start_at(url, regex, options = {}, &block) ⇒ Object
regex use for match url with this faction could find specific url.
-
.user_agent ⇒ String
The User-Agent string used by all Agent objects by default.
-
.user_agent=(new_agent) ⇒ Object
Sets the Spidr User-Agent string.
Class Method Details
.disable_proxy! ⇒ Object
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 |
.host(name, options = {}, &block) ⇒ Object
97 98 99 |
# File 'lib/spidr/spidr.rb', line 97 def Spidr.host(name,={},&block) Agent.host(name,,&block) end |
.proxy ⇒ Hash
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 |
.proxy=(new_proxy) ⇒ Hash
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 |
.site(url, options = {}, &block) ⇒ Object
104 105 106 |
# File 'lib/spidr/spidr.rb', line 104 def Spidr.site(url,={},&block) Agent.site(url,,&block) end |
.start_at(url, regex, options = {}, &block) ⇒ Object
regex use for match url with this faction could find specific url
81 82 83 |
# File 'lib/spidr/spidr.rb', line 81 def Spidr.start_at(url,={},&block) Agent.start_at(url,,&block) end |
.user_agent ⇒ String
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 |
.user_agent=(new_agent) ⇒ Object
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 |