anti-captcha 0.0.3 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc128e3eb750d5047b91a0ff9d8ff8e364fafe41
4
- data.tar.gz: 089e1095c4d9a54a3e2cd887474cd5b24a9d2b54
3
+ metadata.gz: ff944e52dda52014a0bac8a4f499d67ee352fbe4
4
+ data.tar.gz: 69c8e9bd43533461dc5264332e6e601b93135ca5
5
5
  SHA512:
6
- metadata.gz: b357f0af5d93890610a7a6aa691aaf3c692ce4c2c8a96bd2b5a2845b82fe3771843de3c868a7bc75ed1e7d3a19feadb625ece2dcc616a49ca0a7e8a0b4b31578
7
- data.tar.gz: 3252b988828504969027403e5f419cebd00519ec7626b3e0c3a4dd7be721f1f05a3531841657eadf99fa76f4a5ee0506fa0e62f26877cf9f18ae57f946549a19
6
+ metadata.gz: 90abc4e586eaba6074a51d334ffcc0b8ada0c36664508c4427b44db874cfc0187d389a4c9772bb8cfe383373414df0350e63add4c2ae69a3bbe5db444b4df167
7
+ data.tar.gz: 1aa0d59ed0c144edb0e385cb43fb3b595bbe157aeb15731abdf3cd9c85709f70a2a719263071c96fd66bfc22a46e60a15ef0dfd5bff8d1e3f2586182237f5a8e
data/README.md CHANGED
@@ -30,7 +30,18 @@ end
30
30
 
31
31
  ```ruby
32
32
  @client = AntiCaptcha::Client.new(retries_count: 5, phrase: 1)
33
- code = @client.code(image_content)
33
+ code = @client.decode(image_content)
34
+ ```
35
+
36
+ ```ruby
37
+ @client = AntiCaptcha::Client.new(retries_count: 5, phrase: 1)
38
+ code = @client.decode(image_content_base64, :base64)
39
+ ```
40
+
41
+ ## Upload to rubygems.org
42
+
43
+ ```
44
+ gem release anti-captcha.gemspec
34
45
  ```
35
46
 
36
47
  ## Contributing
@@ -11,8 +11,10 @@ module AntiCaptcha
11
11
  @options = AntiCaptcha.configuration.options.merge(options)
12
12
  end
13
13
 
14
- def decode(image)
15
- case request_image(image)
14
+ # type: file data (bin)
15
+ # type: base64 (base64)
16
+ def decode(image, type = :bin)
17
+ case request_image(image, type)
16
18
  when /OK\|(.+)/
17
19
  @captcha_id = $1
18
20
  check
@@ -70,9 +72,12 @@ module AntiCaptcha
70
72
  id: @captcha_id
71
73
  end
72
74
 
73
- def request_image(image)
75
+ # type: file data (bin)
76
+ # type: base64 (base64)
77
+ def request_image(image, type = :bin)
78
+ body = (type == :bin ? Base64.encode64(image) : image)
74
79
  request 'http://anti-captcha.com/in.php',
75
- @options.merge(method: 'base64', body: Base64.encode64(image))
80
+ @options.merge(method: 'base64', body: body)
76
81
  end
77
82
 
78
83
  def request_report_bad
@@ -1,3 +1,3 @@
1
1
  module AntiCaptcha
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anti-captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - debbbbie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-03 00:00:00.000000000 Z
11
+ date: 2015-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake