CAPTCHAs.IO OnlineBooking UserScript

This script is a UserScript to auto solve captchas in http://onlinebooking.sand.telangana.gov.in/Masters/Home.aspx the SSMMS or Sand Sale Management and Monitoring System website.

Tính đến 14-11-2019. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        CAPTCHAs.IO OnlineBooking UserScript
// @namespace   https://app.captchas.io/ssmms/
// @include     https://onlinebooking.sand.telangana.gov.in/Masters/Home.aspx
// @include     *
// @connect     app.captchas.io
// @grant       GM.xmlHttpRequest
// @version     1.0.2
// @description This script is a UserScript to auto solve captchas in http://onlinebooking.sand.telangana.gov.in/Masters/Home.aspx the SSMMS or Sand Sale Management and Monitoring System website.
// ==/UserScript==

function getBase64(img) {
	var canvas = document.createElement('canvas');
	var ctx = canvas.getContext('2d');

	canvas.width = img.width
	canvas.height = img.height
	ctx.drawImage(img, 0, 0)

	return canvas.toDataURL();
}

function doAnswer(k, b) {
	var __data = new FormData();
	__data.append("key", k);
	__data.append("body", b);

	GM.xmlHttpRequest ({
		method: "POST",
		data: __data,
		url: 'https://app.captchas.io/ssmms/validator',
		onload: function(response) {
			var result = JSON.parse(response.responseText);

			if (result.status == 'OK') {
				document.querySelector('#txtEnterCode').value = result.answer;
			} else {
				console.log(response.responseText);
			}
		}
	});
};

(function() {
	'use strict';

	var key = '<YOUR_CAPTCHAs_IO_API_KEY>';
	var base64 = getBase64(document.querySelector('#imgCaptcha'));

	doAnswer(key, base64);
})();