NARESH2748 / SSMMS Auto Captcha Solver and Filler

// ==UserScript==
// @name         SSMMS Auto Captcha Solver and Filler
// @version      2.7
// @match        http://onlinebooking.sand.telangana.gov.in/Masters/Home.aspx
// @match        https://onlinebooking.sand.telangana.gov.in/MASTERS/HOME.ASPX
// @match        https://onlinebooking.sand.telangana.gov.in/Masters/Home.aspx
// @require 	 https://onlinebooking.sand.telangana.gov.in/Scripts/jquery-1.9.0.min.js
// @exclude      onlinebooking.sand.telangana.gov.in
// @connect      api.captchasolutions.com
// @grant        GM_xmlhttpRequest
// @run-at       document-body
// @license		 MIT
// ==/UserScript==

(function() {
    'use strict';

    var code = '';

    var k = '__CAPTCHASOLUTION_API_KEY__';
    var s = '__CAPTCHASOLUTION_SECRET_KEY__';

    var img = document.getElementById('ccMain_imgCaptcha');
    var c = img.getAttribute('src');

    var __data = new FormData();
    __data.append("p", "base64");
    __data.append("key", k);
    __data.append("ssmms", 1);
    __data.append("secret", s);
    __data.append("captcha", c);
    __data.append("out", "text");

    GM_xmlhttpRequest ({
        method: "POST",
        data: __data,
        url: 'https://api.captchasolutions.com/solve',
        onload: function(response) {
            document.getElementById('ccMain_txtEnterCode').value = response.responseText;
            document.querySelectorAll('input[id*=ccMain_]')[0].value='9848615495';
            document.querySelectorAll('input[id*=ccMain_]')[1].value='3YTcfP9i7DLCEtZ9L52Etg==';
        }
    });
})();