Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Using DeathByCaptcha API on Ruby?

Tried to post this on BHW but that gay ass site has so many restrictions (telling me there is a URL in the code below; not allowed for new users) that I decided to come and try my luck here. I'm trying to use the DBC API with Ruby and I need a little bit of help. Any help is appreciated.

---------------------

This is my code:

Code
@driver.get("MyURL")
    captchaUrl = @driver.find_element(:id, "recaptcha_challenge_image").attribute("src")
    client = DeathByCaptcha.http_client('username', 'password')
    response = client.decode captchaUrl
    dbcfields = response.split('"')
    puts dbcfields[9]

I get an error on split. I have been trying this different ways (most of which do not use split), but between a poor knowledge of Ruby and some poor documentation for DBC API, I cannot figure this out.

The line, "puts response" outputs results, but the output looks like this:

Code
{"status"=>0, "captcha"=>296866378, "is_correct"=>true, "text"=>"year yestrease"}

It is correctly solving the Captcha. However, I cannot extract the response field from the string. I tried using split but I got an "undefined method" for split. I am guessing this means that response is not an actual string.

DBC has several methods for their API, and any solution using the API is acceptable to me as long as I can understand it.

Thank you in advance.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Lua] by SigmaMay 12, 2021 04:43 PM 0 238 May 12, 2021 04:43 PM
Last Post: Sigma
[Tutorial] by ruka urushibaharaAug 22, 2018 05:37 AM 0 169 Aug 22, 2018 05:37 AM
Last Post: ruka urushibahara
[Release] by VanderbiltOct 7, 2017 12:38 AM 0 151 Oct 7, 2017 12:38 AM
Last Post: Vanderbilt