Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples solve #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ Grid method is originally called Old reCAPTCHA V2 method. The method can be used
```ruby
result = client.grid({
image: 'path/to/captcha.jpg',
rows: 3,
cols: 3,
recaptcharows: 3,
recaptchacols: 3,
previous_id: 0,
lang: 'en',
hint_image: 'path/to/hint.jpg',
hint_text: 'Select all images with an Orange'
imginstructions: 'path/to/hint.jpg',
textinstructions: 'Select all images with an Orange'
})
```

Expand Down
8 changes: 4 additions & 4 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ result = client.capy({
```ruby
result = client.grid({
image: 'path/to/captcha.jpg',
rows: 3,
cols: 3,
recaptcharows: 3,
recaptchacols: 3,
previous_id: 0,
lang: 'en',
hint_image: 'path/to/hint.jpg',
hint_text: 'Select all images with an Orange'
imginstructions: 'path/to/hint.jpg',
textinstructions: 'Select all images with an Orange'
})
```

Expand Down
14 changes: 14 additions & 0 deletions examples/amazon_waf_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.amazon_waf({
sitekey: '0x1AAAAAAAAkg0s2VIOD34y5',
iv: 'CgAHbCe2GgAAAAAj',
context: '9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ1Jydeaja94iAS49ljb+sUNLoukWedAQZKrlY4RdbOOzvcFqmD/ZepQFS9N5w15Exr4VwnVq+HIxTsDJwRviElWCdzKDebN/mk8/eX2n7qJi5G3Riq0tdQw9+C4diFZU5E97RSeahejOAAJTDqduqW6uLw9NsjJBkDRBlRjxjn5CaMMo5pYOxYbGrM8Un1JH5DMOLeXbq1xWbC17YSEoM1cRFfTgOoc+VpCe36Ai9Kc=',
pageurl: 'https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest',
challenge_script: "https://41bcdd4fb3cb.610cd090.us-east-1.token.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/challenge.js",
captcha_script: "https://41bcdd4fb3cb.610cd090.us-east-1.captcha.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/captcha.js"
})

puts "Result: #{result.inspect}"
13 changes: 13 additions & 0 deletions examples/canvas_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.canvas({
image: 'path/to/captcha.jpg',
previous_id: 0,
lang: 'en',
hint_image: 'path/to/hint.jpg',
hint_text: 'Draw around apple'
})

puts "Result: #{result.inspect}"
11 changes: 11 additions & 0 deletions examples/capy_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.capy({
sitekey: 'PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
pageurl: 'http://mysite.com/',
api_server: 'https://jp.api.capy.me/'
})

puts "Result: #{result.inspect}"
15 changes: 15 additions & 0 deletions examples/cloudflare_turnstile_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.turnstile({
sitekey: "0x0AAAAAAADnPIDROzbs0Aaj",
data: "7fab0000b0e0ff00",
pagedata: "3gAFo2...0ME1UVT0=",
pageurl: "https://2captcha.com/",
action: "managed",
userAgent: "Mozilla/5.0 ... Chrome/116.0.0.0 Safari/537.36",
json: 1
})

puts "Result: #{result.inspect}"
12 changes: 12 additions & 0 deletions examples/coordinates_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.coordinates({
image: 'path/to/captcha.jpg',
lang: 'en',
hint_image: 'path/to/hint.jpg',
hint_text: 'Connect the dots'
})

puts "Result: #{result.inspect}"
11 changes: 11 additions & 0 deletions examples/cut_captcha_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.cutcaptcha({
misery_key: "a1488b66da00bf332a1488993a5443c79047e752",
api_key: "SAb83IIB",
pageurl: "https://example.cc/foo/bar.html"
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/cyber_siara_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.cyber_siara({
pageurl: "https://test.com",
master_url_id: "12333-3123123"
})

puts "Result: #{result.inspect}"
12 changes: 12 additions & 0 deletions examples/datadome_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.data_dome({
pageurl: "https://test.com",
captcha_url: "https://test.com/captcha/",
proxytype: "http",
proxy: "proxyuser:[email protected]:3128"
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/friendly_captcha_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.friendly({
pageurl: "https://example.com",
sitekey: "2FZFEVS1FZCGQ9"
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/funcaptcha_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.funcaptcha({
publickey: "69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC",
pageurl: "https://mysite.com/page/with/funcaptcha",
surl: "https://client-api.arkoselabs.com"})

puts "Result: #{result.inspect}"
12 changes: 12 additions & 0 deletions examples/geetest_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.geetest({
gt: 'f1ab2cdefa3456789012345b6c78d90e',
api_server: 'api-na.geetest.com',
challenge: '12345678abc90123d45678ef90123a456b',
pageurl: 'https://www.site.com/page/'
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/geetest_v4_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.geetest_v4({
captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73',
pageurl: 'https://www.site.com/page/'
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/hcaptcha_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.hcaptcha({
sitekey: '10000000-ffff-ffff-ffff-000000000001',
pageurl: 'https://www.site.com/page/'
})

puts "Result: #{result.inspect}"
13 changes: 13 additions & 0 deletions examples/key_captcha_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.keycaptcha({
s_s_c_user_id: 10,
s_s_c_session_id: '493e52c37c10c2bcdf4a00cbc9ccd1e8',
s_s_c_web_server_sign: '9006dc725760858e4c0715b835472f22-pz-',
s_s_c_web_server_sign2: '2ca3abe86d90c6142d5571db98af6714',
pageurl: 'https://www.keycaptcha.ru/demo-magnetic/'
})

puts "Result: #{result.inspect}"
12 changes: 12 additions & 0 deletions examples/lemin_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.lemin({
captcha_id: 'CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
div_id: 'lemin-cropped-captcha',
pageurl: 'https://www.site.com/page/',
api_server: "https://api.leminnow.com/"
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/mt_captcha_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.mt_captcha({
pageurl: "https://service.mtcaptcha.com/mtcv1/demo/index.html",
sitekey: "MTPublic-DemoKey9M"
})

puts "Result: #{result.inspect}"
13 changes: 13 additions & 0 deletions examples/rotate_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.rotate({
image: 'path/to/captcha.jpg',
angle: 40,
lang: 'en',
hint_image: 'path/to/hint.jpg',
hint_text: 'Put the images in the correct way'
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/text_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.text({
textcaptcha:'If tomorrow is Saturday, what day is today?',
lang: "en"
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/yandex_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.yandex({
sitekey: 'Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV',
url: "https://rutube.ru"
})

puts "Result: #{result.inspect}"
2 changes: 1 addition & 1 deletion lib/api_2captcha/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def capy(params)
end

def grid(params)
params["recaptcha"] = 1
params[:recaptcha] = 1
solve("post", **params)
end

Expand Down