1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to embed API (Decaptcher) to a current project?

Discussion in 'Black Hat SEO Tools' started by king111, Jun 24, 2011.

  1. king111

    king111 Registered Member

    Joined:
    Aug 12, 2009
    Messages:
    92
    Likes Received:
    200
    anybody here who knows how to embed API (c/c++/php or c#) from decapther to an existing project? Sorry I am a total noob in this.

    I want to test an automatic ocr , therefore I need to download API. I know that, in order to establish a connection, I have to enter my login details somewhere in the API files I downloaded, but I doN`t know where exactly. I`ll be happy to give reps to the one who will help me out this problem. Many Thanks :D
     
    Last edited: Jun 24, 2011
  2. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,879
    Likes Received:
    1,932
    Here's some simple functions I made for the HTTP API using PHP:
    PHP:
    function RecogniseCaptcha($filename){
        global 
    $decaptcheruser,$decaptcherpass;
        
    $cookie_file_path "cookies/decaptcher.txt"
        
    $postData = array();
        
    $postData'function' ] = "picture2";
        
    $postData'username' ] = "$decaptcheruser";
        
    $postData'password' ] = "$decaptcherpass";
        
    $postData'pict_to' ] = "0";
        
    $postData'pict_type' ] = "0";
        
    $postData'pict' ] = '@'.realpath("$filename");
        
    $postData'submit' ] = "Send";
        
    $ch curl_init();    
        
    curl_setopt($chCURLOPT_URL$address); 
        
    curl_setopt($chCURLOPT_USERAGENT$agent);
        
    curl_setopt($chCURLOPT_POST1);  
        
    curl_setopt($chCURLOPT_POSTFIELDS,$postdata); 
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
        
    $data curl_exec($ch);  
        
    curl_close($ch);  
        
    $pieces explode ("|"$data);
        
    $total count($pieces);
        if (
    $total<6){$pieces = array("","","","","","");}
        return 
    $pieces;
        }
    function 
    CheckDecaptcherBalance(){
        global 
    $decaptcheruser,$decaptcherpass;
        
    $ch curl_init();    
        
    curl_setopt($chCURLOPT_URL"http://poster.decaptcher.com/"); 
        
    curl_setopt($chCURLOPT_POST1);  
        
    curl_setopt($chCURLOPT_POSTFIELDS,"function=balance&username=$decaptcheruser&password=$decaptcherpass"); 
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
        
    $result curl_exec($ch);  
        
    curl_close($ch);  
        return 
    $result;
        }
    function 
    Decaptcher_Refund($major_id,$minor_id){
        global 
    $decaptcheruser,$decaptcherpass;
        
    $ch curl_init();    
        
    curl_setopt($chCURLOPT_URL"http://poster.decaptcher.com/"); 
        
    curl_setopt($chCURLOPT_POST1);  
        
    curl_setopt($chCURLOPT_POSTFIELDS,"function=picture_bad2&username=$decaptcheruser&password=$decaptcherpass&major_id=$major_id&minor_id=$minor_id"); 
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
        
    $result curl_exec($ch);  
        
    curl_close($ch);  
        return 
    $result;
        }
     
    • Thanks Thanks x 1
  3. king111

    king111 Registered Member

    Joined:
    Aug 12, 2009
    Messages:
    92
    Likes Received:
    200
    Thanks! Do I have to copy & paste this code? Where Do I put the php files then?
     
  4. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,879
    Likes Received:
    1,932
    You can put this into any of your PHP files that are included where you need to use the functions or place it directly into the file where you want to use the functions then download the captcha image and call the function, E.g.
    $captcha_answer = RecogniseCaptcha("decaptcher.jpg");

    Note that Decaptcher have now changed their URL to de-captcher.com.