ruby-2captcha 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/api_2captcha.gemspec +1 -0
- data/lib/api_2captcha/client.rb +8 -3
- data/lib/api_2captcha/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6faa77836721484cbde480e6915021cb39fb199d05ab52333240e34db98de1a8
|
4
|
+
data.tar.gz: 621afa748b261f8a1f0e85fad80e95597d268358874931864abc7f670e9f994a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a53cc1fe3f45c0b7a157eaa25bf85c22298351916ae992ae851a2d32e726e45e00ac6a91c7a23b4508643abd76c29ca8c04225ef6f2a4f49f2396c84b8266127
|
7
|
+
data.tar.gz: 9b738e21dd5af75ae17986a3a28f5229e1994cb6cbca67823dadb16ff766ae1ea88a425dec1281dbb8c4ac93f7fd1f670d92da093d043dacb507c51057f0f018
|
data/README.md
CHANGED
@@ -56,13 +56,13 @@ To use the api2captcha gem, you'll need to import the module and create a Client
|
|
56
56
|
```ruby
|
57
57
|
require 'api-2captcha'
|
58
58
|
|
59
|
-
client = Api2Captcha.new(
|
59
|
+
client = Api2Captcha.new("YOUR_API_KEY")
|
60
60
|
```
|
61
61
|
|
62
62
|
There are a few options that can be configured using the Client instance:
|
63
63
|
|
64
64
|
```ruby
|
65
|
-
client.
|
65
|
+
client.api_key = "YOUR_API_KEY"
|
66
66
|
```
|
67
67
|
|
68
68
|
### Client instance options
|
data/api_2captcha.gemspec
CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/2captcha/2captcha-ruby"
|
19
19
|
spec.metadata["changelog_uri"] = "https://github.com/2captcha/2captcha-ruby/releases"
|
20
|
+
spec.metadata["github_repo"] = "ssh://github.com/2captcha/2captcha-ruby"
|
20
21
|
|
21
22
|
# Specify which files should be added to the gem when it is released.
|
22
23
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/api_2captcha/client.rb
CHANGED
@@ -31,10 +31,16 @@ class Api2Captcha::Client
|
|
31
31
|
params["key"] = @api_key
|
32
32
|
params["soft_id"] = @soft_id
|
33
33
|
params["json"] = 1
|
34
|
-
|
34
|
+
if @callback
|
35
|
+
params["pingback"] = @callback
|
36
|
+
return_id = true
|
37
|
+
else
|
38
|
+
return_id
|
39
|
+
end
|
35
40
|
complete_params = get_params(params)
|
36
41
|
captcha_id = send_request(complete_params)
|
37
|
-
|
42
|
+
|
43
|
+
return_id ? captcha_id : get_result(captcha_id)
|
38
44
|
end
|
39
45
|
|
40
46
|
def send(*args)
|
@@ -184,7 +190,6 @@ class Api2Captcha::Client
|
|
184
190
|
req.content_type = 'application/json'
|
185
191
|
req.body = params.to_json
|
186
192
|
captcha_id = get_captcha_id(make_request(uri, req))
|
187
|
-
handle_response(captcha_id)
|
188
193
|
end
|
189
194
|
|
190
195
|
def get_params(params)
|
data/lib/api_2captcha/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-2captcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 2captcha.com
|
@@ -40,6 +40,7 @@ metadata:
|
|
40
40
|
homepage_uri: https://2captcha.com/
|
41
41
|
source_code_uri: https://github.com/2captcha/2captcha-ruby
|
42
42
|
changelog_uri: https://github.com/2captcha/2captcha-ruby/releases
|
43
|
+
github_repo: ssh://github.com/2captcha/2captcha-ruby
|
43
44
|
post_install_message:
|
44
45
|
rdoc_options: []
|
45
46
|
require_paths:
|