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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 177a55d48556f0343f77652994e9b13e44d777077c57a7d561ade59e58a32754
4
- data.tar.gz: 1a48b0d00f94fc58ce887e253252107a8d7db850be45ebc9dad9929e64d004f8
3
+ metadata.gz: 142cb40b28842b4e688a2bd8235fae69cb20ca107a46df27e4db2005a766ec24
4
+ data.tar.gz: 7f2b2f6139d024243913b1386aa325b389ae87a6eff829997fd85d7178675190
5
5
  SHA512:
6
- metadata.gz: 1d068338b333e3304f5763ff7c586f8a6c3c7f6e534d4cebc2dde68716e1a3cd1b686482efe62bf92554f77663b721b5591ea24af3d7beb1f7cdd18b40dad3c7
7
- data.tar.gz: 8bcbd91173c3fadca072c8e579e0c23752a8bd777720fb4b480897ff4032e9bae753c2da6aa9e7d568e8b28b9cd693c96dd00b8279280bf2fcd339f70cf6cc57
6
+ metadata.gz: 179d9a646404068b354e1ff6c4e36b10710f08f01673b49bcd48e45c385fbc6d490abaf27e14c521226e51a845512ec52a07841a7cbccc1a85734c436f39126f
7
+ data.tar.gz: 4b855c309c7c59d490ee7fbd439bde890039f51ef948f0bbe1338c1214d1fed4df75dd2e1aa4f41b390c5f6808a100d3805732b037b8d7a7d052da6dafca0257
@@ -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="257000" />
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="1578489407708">
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="1578489407708" />
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>
@@ -48,7 +48,7 @@ module ScraperAPI
48
48
  country_code: nil,
49
49
  premium: false,
50
50
  render: false,
51
- session_number: NIL,
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: NIL,
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
@@ -1,3 +1,3 @@
1
1
  module ScraperAPI
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-23 00:00:00.000000000 Z
11
+ date: 2020-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler