spidy 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spidy/connector.rb +9 -0
- data/lib/spidy/connector/html.rb +2 -0
- data/lib/spidy/connector/json.rb +2 -0
- data/lib/spidy/connector/xml.rb +2 -0
- data/lib/spidy/definition.rb +1 -1
- data/lib/spidy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 177e6b5e3b4f864251d7071d23b2b42b219d8193673a5b57ee9b376e393092a9
|
4
|
+
data.tar.gz: 92b39a277d752eb5b1944f822702eae803356f7f5e3211b1f91e2d9ad635090e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4078e3d1ad9813b0273f267d99bf7a9bf4473bb86b6cfa4fa283e6c5b060fa248e0b6fb517bede448f94e0dcebbb90ee71ef4eeb4bd5a45b1405c50005985fe
|
7
|
+
data.tar.gz: 00aa2cd512cf3a083082227234f59148d86e8ee0e4f602e07d1c67cbf9f3e8160b9144ebd29f3a67efded607c1705c2ce3008df235325afc7f3a715a6dd7527d
|
data/lib/spidy/connector.rb
CHANGED
@@ -10,6 +10,15 @@ module Spidy::Connector
|
|
10
10
|
autoload :Json
|
11
11
|
autoload :Xml
|
12
12
|
|
13
|
+
module StaticAccessor
|
14
|
+
extend ActiveSupport::Concern
|
15
|
+
class_methods do
|
16
|
+
def call(url, wait_time: nil, user_agent: Spidy::Connector::USER_AGENT, &block)
|
17
|
+
new(wait_time: wait_time, user_agent: user_agent).call(url, &block)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
13
22
|
#
|
14
23
|
# retry class
|
15
24
|
#
|
data/lib/spidy/connector/html.rb
CHANGED
data/lib/spidy/connector/json.rb
CHANGED
data/lib/spidy/connector/xml.rb
CHANGED
data/lib/spidy/definition.rb
CHANGED
@@ -50,7 +50,7 @@ module Spidy::Definition
|
|
50
50
|
|
51
51
|
def define(name = :default, connector: nil, binder: nil, as: nil, &define_block)
|
52
52
|
@namespace ||= {}
|
53
|
-
connector = Spidy::Connector.get(connector || as, wait_time: @wait_time, user_agent: @user_agent)
|
53
|
+
connector = Spidy::Connector.get(connector || as, wait_time: @wait_time, user_agent: @user_agent, socks_proxy: @socks_proxy)
|
54
54
|
binder = Spidy::Binder.get(self, binder || as)
|
55
55
|
@namespace[:"#{name}_scraper"] = define_proc(name, connector, binder, define_block)
|
56
56
|
end
|
data/lib/spidy/version.rb
CHANGED