scraperapi 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +5 -3
- data/lib/scraper_api.rb +9 -2
- data/lib/scraperapi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 142cb40b28842b4e688a2bd8235fae69cb20ca107a46df27e4db2005a766ec24
|
4
|
+
data.tar.gz: 7f2b2f6139d024243913b1386aa325b389ae87a6eff829997fd85d7178675190
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 179d9a646404068b354e1ff6c4e36b10710f08f01673b49bcd48e45c385fbc6d490abaf27e14c521226e51a845512ec52a07841a7cbccc1a85734c436f39126f
|
7
|
+
data.tar.gz: 4b855c309c7c59d490ee7fbd439bde890039f51ef948f0bbe1338c1214d1fed4df75dd2e1aa4f41b390c5f6808a100d3805732b037b8d7a7d052da6dafca0257
|
data/.idea/workspace.xml
CHANGED
@@ -212,7 +212,9 @@
|
|
212
212
|
<updated>1578440970015</updated>
|
213
213
|
<workItem from="1578440971343" duration="6054000" />
|
214
214
|
<workItem from="1579805328445" duration="106000" />
|
215
|
-
<workItem from="1579805474675" duration="
|
215
|
+
<workItem from="1579805474675" duration="969000" />
|
216
|
+
<workItem from="1579963914430" duration="1068000" />
|
217
|
+
<workItem from="1580074273123" duration="1035000" />
|
216
218
|
</task>
|
217
219
|
<servers />
|
218
220
|
</component>
|
@@ -236,9 +238,9 @@
|
|
236
238
|
<screen x="0" y="23" width="1680" height="1027" />
|
237
239
|
</state>
|
238
240
|
<state width="1638" height="280" key="GridCell.Tab.0.right/0.23.1680.1027@0.23.1680.1027" timestamp="1578441002077" />
|
239
|
-
<state x="505" y="250" width="670" height="676" key="search.everywhere.popup" timestamp="
|
241
|
+
<state x="505" y="250" width="670" height="676" key="search.everywhere.popup" timestamp="1580075594435">
|
240
242
|
<screen x="0" y="23" width="1680" height="1027" />
|
241
243
|
</state>
|
242
|
-
<state x="505" y="250" width="670" height="676" key="search.everywhere.popup/0.23.1680.1027@0.23.1680.1027" timestamp="
|
244
|
+
<state x="505" y="250" width="670" height="676" key="search.everywhere.popup/0.23.1680.1027@0.23.1680.1027" timestamp="1580075594435" />
|
243
245
|
</component>
|
244
246
|
</project>
|
data/lib/scraper_api.rb
CHANGED
@@ -48,7 +48,7 @@ module ScraperAPI
|
|
48
48
|
country_code: nil,
|
49
49
|
premium: false,
|
50
50
|
render: false,
|
51
|
-
session_number:
|
51
|
+
session_number: nil,
|
52
52
|
autoparse: false,
|
53
53
|
retry_n: 3,
|
54
54
|
timeout: 60,
|
@@ -73,7 +73,7 @@ module ScraperAPI
|
|
73
73
|
country_code: nil,
|
74
74
|
premium: false,
|
75
75
|
render: false,
|
76
|
-
session_number:
|
76
|
+
session_number: nil,
|
77
77
|
autoparse: false,
|
78
78
|
retry_n: 3,
|
79
79
|
timeout: 60,
|
@@ -122,9 +122,12 @@ module ScraperAPI
|
|
122
122
|
:render => render,
|
123
123
|
:session_number => session_number,
|
124
124
|
:autoparse => autoparse,
|
125
|
+
:keep_headers => !headers.empty?,
|
125
126
|
:url => url
|
126
127
|
}
|
127
128
|
|
129
|
+
begin
|
130
|
+
retries ||= 0
|
128
131
|
Unirest.timeout(timeout)
|
129
132
|
|
130
133
|
scraperapi_basepath = "https://api.scraperapi.com/"
|
@@ -141,6 +144,10 @@ module ScraperAPI
|
|
141
144
|
return Unirest.put(uri.to_s, headers:headers, parameters: body)
|
142
145
|
end
|
143
146
|
|
147
|
+
rescue
|
148
|
+
retry if (retries += 1) <= retry_n
|
149
|
+
end
|
150
|
+
|
144
151
|
end
|
145
152
|
|
146
153
|
end
|
data/lib/scraperapi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scraperapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scraper Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|