proxycrawl 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -4
- data/lib/proxycrawl/api.rb +1 -5
- data/lib/proxycrawl/version.rb +2 -2
- data/proxycrawl.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab95c07f3180f82c6b77af90fa5c947fc2af592e
|
4
|
+
data.tar.gz: daa80f3339e9cefe929a9600c0865319cf790bbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f9ce2ddfdfb1e2865f64c3a7f505fb6dadaaacb9a5a3c5ef337af1db83ded51dcb4d8e6bb67269876365f2f190f1231dba3477ae683f784aabd9770735e6133
|
7
|
+
data.tar.gz: b6eedbe01aa37e9a7bb3bd481a761460b98c1ba6be5f48e51fbcf5326e279bba7badc6eecc1337d6fba929d0326e12be29ba47b9a31cbe0894ba092f7a166ae2
|
data/README.md
CHANGED
@@ -64,10 +64,8 @@ options = {
|
|
64
64
|
|
65
65
|
response = api.get('https://www.reddit.com/r/pics/comments/5bx4bx/thanks_obama/', options)
|
66
66
|
|
67
|
-
puts response.body
|
68
67
|
puts response.status_code
|
69
|
-
puts response.
|
70
|
-
puts response.pc_status
|
68
|
+
puts response.body # read the API json response
|
71
69
|
```
|
72
70
|
|
73
71
|
### POST requests
|
@@ -89,7 +87,7 @@ You can send the data as application/json instead of x-www-form-urlencoded by se
|
|
89
87
|
```ruby
|
90
88
|
response = api.post('https://httpbin.org/post', { some_json: 'with some value' }, { post_content_type: 'json' })
|
91
89
|
|
92
|
-
puts response.
|
90
|
+
puts response.status_code
|
93
91
|
puts response.body
|
94
92
|
|
95
93
|
```
|
data/lib/proxycrawl/api.rb
CHANGED
@@ -67,12 +67,8 @@ module ProxyCrawl
|
|
67
67
|
|
68
68
|
def prepare_response(response, format)
|
69
69
|
if format == 'json'
|
70
|
-
json_response = JSON.parse(response.body)
|
71
|
-
@original_status = json_response['original_status'].to_i
|
72
70
|
@status_code = response.code.to_i
|
73
|
-
@
|
74
|
-
@body = json_response['body']
|
75
|
-
@url = json_response['url']
|
71
|
+
@body = response.body
|
76
72
|
else
|
77
73
|
@original_status = response['original_status'].to_i
|
78
74
|
@status_code = response.code.to_i
|
data/lib/proxycrawl/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "0.
|
1
|
+
module ProxyCrawl
|
2
|
+
VERSION = "0.2.0"
|
3
3
|
end
|
data/proxycrawl.gemspec
CHANGED
@@ -5,7 +5,7 @@ require "proxycrawl/version"
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "proxycrawl"
|
8
|
-
spec.version =
|
8
|
+
spec.version = ProxyCrawl::VERSION
|
9
9
|
spec.platform = Gem::Platform::RUBY
|
10
10
|
spec.authors = ["proxycrawl"]
|
11
11
|
spec.email = ["info@proxycrawl.com"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxycrawl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- proxycrawl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|