0.0.1 • Published 10 years ago

agate v0.0.1

Weekly downloads
1
License
BSD-2-Clause
Repository
-
Last release
10 years ago

Agate

Antigate.com client that does not suck.

Promise powered, based on Q and urllib.

Install

npm install agate

Use

If your captcha is a file, use the following code:

var Agate = require('agate');
var ag = new Agate('your-32-byte-key');
ag.recognizeFile('./captcha.jpg')
    .then(function (text) {
        console.log('CPTCHA is recognized:', text);
    })
    .catch(function (error) {
        console.error('Error:', error);
    });

If your captcha is base64 string, use the following code:

var Agate = require('agate');
var ag = new Agate('your-32-byte-key');
ag.recognizeBase64('R0lGODlhAAAAAAAP///yH5BAEAAAA...SHORTENED FOR READABILITY')
    .then(function (text) {
        console.log('CPTCHA is recognized:', text);
    })
    .catch(function (error) {
        console.error('Error:', error);
    });