2017 © Pedro Peláez
 

library anti-captcha-client

A PHP library to connect to https://anti-captcha.com

image

randock/anti-captcha-client

A PHP library to connect to https://anti-captcha.com

  • Saturday, June 17, 2017
  • by Mastercoding
  • Repository
  • 4 Watchers
  • 0 Stars
  • 760 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 96 % Grown

The README.md

Build Status, (*1)

Anti-captcha API

This library integrates the https://anti-captcha.com API in PHP., (*2)

Installing

The easiest way to install the library is using composer:, (*3)

composer require randock/anti-captcha-client

Usage

The library can be used by creating an instance of the client and calling the appropriate methods., (*4)

For example, to create a new task:, (*5)

<?php

use Randock\AntiCaptcha\Client;
use Randock\AntiCaptcha\Task\ImageToTextTask;
use Randock\AntiCaptcha\Solution\ImageToTextSolution;
use Randock\AntiCaptcha\Exception\InvalidRequestException;

// create a new client
$client = new Client('<<API KEY>>');

// create the task to be send
$task = new ImageToTextTask();

// set the body
$task->setBody('<<BASE 64 of captcha>>');
//$task->setBodyFromFile($file);

try {
    // send the task to anti-captcha.com
    $task = $client->createTask($task);

    do {
        // wait a bit before (re)trying
        sleep(2);

        $taskResult = $client->getTaskResult($task);
    } while ($taskResult->isProcessing());

    /* @var ImageToTextSolution $solution */
    $solution = $taskResult->getSolution();

    // grab captcha text
    $captcha = $solution->getText();
} catch (InvalidRequestException $exception) {
}

The Versions

17/06 2017

dev-develop

dev-develop

A PHP library to connect to https://anti-captcha.com

  Sources   Download

The Requires

 

The Development Requires

by Jop Peters

17/06 2017

dev-master

9999999-dev

A PHP library to connect to https://anti-captcha.com

  Sources   Download

The Requires

 

The Development Requires

by Jop Peters

17/06 2017

0.1

0.1.0.0

A PHP library to connect to https://anti-captcha.com

  Sources   Download

The Requires

 

The Development Requires

by Jop Peters