{"id":269455,"date":"2015-12-02T11:35:02","date_gmt":"2015-12-02T08:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=269455"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=269455","title":{"rendered":"Codecha \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0441\u043a\u0430\u044f \u043a\u0430\u043f\u0447\u0430, \u0438\u043b\u0438 \u043a\u0430\u043a \u043d\u0435 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c API"},"content":{"rendered":"<p>       \u041d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0430\u0439\u0442\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"http:\/\/codecha.org\/\">Codecha<\/a> \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0441\u043a\u0443\u044e \u043a\u0430\u043f\u0447\u0443. \u042d\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u0430\u043f\u0447\u0430, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fa2\/202\/9e2\/fa22029e296cd9317f0cae0d98fdc2a4.png\" alt=\"\u041a\u0414\u041f\u0412 \u2014  \u0432\u0438\u0434\u0436\u0435\u0442 \u044d\u0442\u043e\u0439 \u0441\u0430\u043c\u043e\u0439 \u043a\u0430\u043f\u0447\u0438\"\/><\/p>\n<p>  \u041e\u043d\u0430 \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u043e\u043b\u044c \u0436\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0431\u043e\u0442\u043e\u0432, \u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Google reCAPTCHA (\u043d\u0430\u0431\u043e\u0440 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0438 \u0438\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0440\u0435\u0448\u0430\u0442\u044c, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b), \u043d\u043e \u0437\u0430\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u043e\u0442\u0438\u0432 \u043d\u0435-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 (\u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0444\u043e\u0440\u0443\u043c\u043e\u0432 \u0442\u043e\u043b\u043f\u044b \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432, \u043f\u0440\u043e\u0441\u044f\u0449\u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0445 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u2014 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0445\u0443\u0436\u0435 \u0441\u043f\u0430\u043c-\u0431\u043e\u0442\u043e\u0432). \u041d\u043e \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043d\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0432 \u0445\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Codecha, \u2014 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u0439 API \u043a\u0430\u043a \u0441\u0430\u043c\u043e\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043a\u0430\u043f\u0447\u0438, \u0442\u0430\u043a \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430. \u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f, \u0433\u0434\u0435-\u0442\u043e \u0432 \u0444\u043e\u0440\u043c\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"html\">&lt;script type=&quot;text\/javascript&quot; src=&quot;\/\/codecha.org\/api\/challenge?k=YOUR_PUBLIC_KEY&quot;&gt; &lt;\/script&gt; <\/code><\/pre>\n<p>  \u0421 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u043c \u0432\u0441\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0444\u043e\u0440\u043c\u044b \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u044f <i>codecha_challenge_field<\/i> \u0438 <i>codecha_response_field<\/i>, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 Node.js.<\/p>\n<p>  \u041f\u0430\u0440\u0441\u0438\u043c \u0444\u043e\u0440\u043c\u0443, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u043c\u0438\u0441\u044b \u0438 <a href=\"https:\/\/github.com\/kriskowal\/q-io\">q-io<\/a>):<\/p>\n<pre><code class=\"javascript\">var HTTP = require(&quot;q-io\/http&quot;);  var checkCaptcha = function(req, fields) {     var challenge = fields.codecha_challenge_field;     var response = fields.codecha_response_field;     if (!challenge)         return Promise.reject(&quot;Captcha challenge is empty&quot;);     if (!response)         return Promise.reject(&quot;Captcha is empty&quot;, &quot;error&quot;);     var body = `challenge=${challenge}&response=${response}&remoteip=${req.ip}&privatekey=PRIVTE_KEY`;     var url = &quot;http:\/\/codecha.org\/api\/verify&quot;;     return HTTP.request({         url: url,         method: &quot;POST&quot;,         body: [body],         headers: {             &quot;Content-Type&quot;: &quot;application\/x-www-form-urlencoded&quot;,             &quot;Content-Length&quot;: Buffer.byteLength(body)         },         timeout: (15 * 1000) \/\/15 \u0441\u0435\u043a\u0443\u043d\u0434     }).then(function(response) {         if (response.status != 200)             return Promise.reject(&quot;Failed to check captcha&quot;);         return response.body.read(&quot;utf8&quot;);     }).then(function(data) {         var result = data.toString();         if (result.replace(&quot;true&quot;) == result)             return Promise.reject(&quot;Invalid captcha&quot;);         return Promise.resolve();     }); }; <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 <i>\u00abtrue\u00bb<\/i>, \u0438\u043d\u0430\u0447\u0435 \u2014 \u0441\u0442\u0440\u043e\u043a\u0430 <i>\u00abfalse\u00bb<\/i>.<\/p>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b? \u041d\u043e \u043d\u0435\u0442. \u0412\u0435\u0441\u0435\u043b\u044c\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u043e\u0434\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AJAX \u0438 \u0445\u043e\u0447\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0431\u0435\u0437 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e reCAPTCHA, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <i>grecaptcha.reset<\/i>, \u0430 \u0432\u043e\u0442 \u0443 Codecha \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f. \u041f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043a\u0430\u043f\u0447\u0438 \u0432\u0435\u0441\u044c \u0435\u0435 HTML \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0442\u0435\u043a\u0441\u0442, \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0449\u0438\u0439 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u044f. \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443.<\/p>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0435\u0441\u043b\u0438, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u0430\u043f\u0447\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0430\u0440\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u0435-\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Codecha \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0430\u0440\u044b \u0432\u044b\u0434\u0430\u0441\u0442 <i>\u00abfalse\u00bb<\/i>. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e\u043f\u044f\u0442\u044c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 (\u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0435\u0449\u0435 \u0438 \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u0442 \u0432\u0441\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 \u0444\u043e\u0440\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0435).<\/p>\n<p>  \u041d\u0435\u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f. \u041c\u043e\u0436\u0435\u0442, \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u043a\u0440\u044b\u0442\u044b\u0439 API \u0432\u0438\u0434\u0436\u0435\u0442\u0430? \u0414\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c. \u041d\u043e \u043d\u0435\u0442.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434 \u0442\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0438 \u0432 \u0444\u043e\u0440\u043c\u0443<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var codecha = {     language: &quot;PHP&quot;,     publicKey: &quot;e37ea65c651a4eada4d5d4e97ae92d90&quot;,          fieldPrefix: &quot;codecha_&quot;,     base_url: &quot;\/\/codecha.org&quot;,     spinner_path: &quot;\/static\/ajax-loader.gif&quot;,     css_path: &quot;\/static\/widget.css&quot;,     survey: true,     callbacks: {}, };  codecha.callbacks.hideErrorOverlay = function() {     codecha.errorOverlayDiv.hidden = true;     return false; }  codecha.callbacks.codeSubmit = function() {     var xhr = codecha.CORCSRequest(codecha.base_url + &quot;\/api\/code&quot;);      codecha.disable();      var params = {         'challenge': codecha.challenge,         'code': codecha.codeArea.value     };      xhr.send(codecha.serialize(params));      return false; };  codecha.callbacks.choseLanguage = function() {     codecha.languageSelector.hidden = false;     codecha.languageSelector.style.display = '';     codecha.changeChallenge.value = &quot;\\u2713&quot;;     codecha.button.disabled = true;      codecha.changeChallenge.onclick = codecha.callbacks.requestNewChallenge;     return false; };  codecha.callbacks.requestNewChallenge = function() {     codecha.disable();     codecha.setStatus(&quot;waiting&quot;);     codecha.languageSelector.hidden = true;     codecha.languageSelector.style.display = 'none';     codecha.changeChallenge.value = &quot;change lang&quot;;      var lang = codecha.languageSelector[codecha.languageSelector.selectedIndex].value;      var xhr = codecha.CORCSRequest(codecha.base_url + &quot;\/api\/change&quot;);      var params = {         'challenge': codecha.challenge,         'k': codecha.publicKey,         'lang': lang     };      xhr.send(codecha.serialize(params));          codecha.changeChallenge.onclick = codecha.callbacks.choseLanguage;     return false; };  codecha.callbacks.textAreaKeyPress = function(ev) {     object = codecha.codeArea;     if (ev.keyCode == 9)     {         start = object.selectionStart;         end = object.selectionEnd;           object.value = object.value.substring(0, start) + &quot;\\t&quot; + object.value.substr(end);         object.setSelectionRange(start + 1, start + 1);          object.selectionStart = object.selectionEnd = start + 1;          return false;     }      return true; };  codecha.callbacks.updateState = function() {     var xhr = codecha.CORCSRequest(codecha.base_url + &quot;\/api\/state&quot;);       xhr.send(codecha.serialize({ 'challenge': codecha.challenge }));      return false; };  codecha.callbacks.sendSurvey = function() {     var xhr = codecha.CORCSRequest(codecha.base_url + &quot;\/api\/survey&quot;);      var mark = codecha.surveyMark[codecha.surveyMark.selectedIndex].value;      var params = {         'challenge': codecha.challenge,         'response': codecha.response,         'mark': mark,         'opinion' : codecha.surveyOpinion.value     };      xhr.send(codecha.serialize(params));      return false; };  codecha.callbacks.switchToRecaptcha = function() {     var challengeField = document.getElementById(codecha.fieldPrefix + &quot;challenge_field&quot;);     var responseField = document.getElementById(codecha.fieldPrefix + &quot;response_field&quot;);          codecha.removeElement(codecha.mainDiv);     codecha.removeElement(codecha.recaptchaSwitch);     codecha.removeElement(challengeField);     codecha.removeElement(responseField);      codecha.recaptchaDiv.hidden = false;      var xhr = codecha.CORCSRequest(codecha.base_url + &quot;\/api\/recaptchify&quot;);     var params = { 'challenge': codecha.challenge };      xhr.send(codecha.serialize(params));      return false; };  codecha.removeElement = function(element) {     element.parentElement.removeChild(element); };  codecha.removeRecatpcha = function() {     this.removeElement(this.recaptchaDiv); };  codecha.escape = function(str) {     var div = document.createElement('div');     div.appendChild(document.createTextNode(str));     return div.innerHTML; };  codecha.serialize = function(obj) {     array = [];      for (key in obj) {         array[array.length] = encodeURIComponent(key) + &quot;=&quot; + encodeURIComponent(obj[key]);     }      var result = array.join(&quot;&&quot;);      result = result.replace(\/%20\/g, &quot;+&quot;);     return result; };  codecha.enable = function() {     this.button.disabled = false;     this.changeChallenge.disabled = false;     this.codeArea.disabled = false;     this.spinner.hidden = true; };  codecha.disable = function() {     this.button.disabled = true;     this.changeChallenge.disabled = true;     this.codeArea.disabled = true;     this.spinner.hidden = false; };  codecha.inject_css = function() {     var css_link=document.createElement(&quot;link&quot;);     css_link.setAttribute(&quot;rel&quot;, &quot;stylesheet&quot;);     css_link.setAttribute(&quot;type&quot;, &quot;text\/css&quot;);     css_link.setAttribute(&quot;href&quot;, codecha.base_url + codecha.css_path);     document.getElementsByTagName(&quot;head&quot;)[0].appendChild(css_link); };  codecha.setStatus = function(state) {     this.statusSpan.innerHTML = state; };  codecha.setResponseFields = function() {     var challengeField = document.getElementById(this.fieldPrefix + &quot;challenge_field&quot;);     var responseField = document.getElementById(this.fieldPrefix + &quot;response_field&quot;);      challengeField.value = this.challenge;     responseField.value = this.response;      };  codecha.setChallenge = function(uuid, language_name, wording, top, sampleCode, bottom) {     this.challenge = uuid;     this.wordingDiv.innerHTML = &quot;&lt;strong&gt;&quot; + language_name + &quot;:&lt;\/strong&gt; &quot; + wording;     this.codeAreaTop.innerHTML = &quot;&lt;pre&gt;\\n&quot;+this.escape(top)+&quot;&lt;\/pre&gt;&quot;;     this.codeArea.value = sampleCode;     this.codeAreaBottom.innerHTML = this.escape(bottom);      if (top.length &gt; 0) {         this.codeAreaTop.hidden = false;     } else {         this.codeAreaTop.hidden = true;     }      if (bottom.length &gt; 0) {         this.codeAreaBottom.hidden = false;     } else {         this.codeAreaBottom.hidden = true;     }  };  codecha.showErrorMessage = function(message) {     this.errorMessageDiv.innerHTML = message;     this.errorOverlayDiv.hidden = false; };  codecha.showSurvey = function() {     codecha.mainDiv.innerHTML = &quot;\\         &lt;strong&gt;Challenge completed! You may proceed.&lt;\/strong&gt;     \\         If you have some spare time you may help us improve our widget by answearing any question below.     \\         Challenge was:   \\         &lt;select id=\\&quot;codecha_survey_mark_selector\\&quot;&gt; \\             &lt;option value=\\&quot;5\\&quot;&gt;a way too hard&lt;\/option&gt; \\             &lt;option value=\\&quot;4\\&quot;&gt;a bit too hard&lt;\/option&gt; \\             &lt;option value=\\&quot;3\\&quot; selected&gt;perfect&lt;\/option&gt; \\             &lt;option value=\\&quot;2\\&quot;&gt;a bit too easy&lt;\/option&gt; \\             &lt;option value=\\&quot;1\\&quot;&gt;a way too easy&lt;\/option&gt; \\         &lt;\/select&gt;   \\         How do you like our widget?   \\         &lt;textarea id=\\&quot;codcha_survey_opinion_area\\&quot; name=\\&quot;codcha_survey_opinion_area\\&quot;&gt;I like\/dislike it because...&lt;\/textarea&gt; \\         &lt;input type=\\&quot;submit\\&quot; class=\\&quot;codecha_button\\&quot; name=\\&quot;codecha_survey_submit\\&quot; id=\\&quot;codecha_survey_submit\\&quot; value=\\&quot;SUBMIT\\&quot;\/&gt;\\         &quot;;      codecha.surveySubmit = document.getElementById(&quot;codecha_survey_submit&quot;);     codecha.surveyMark = document.getElementById(&quot;codecha_survey_mark_selector&quot;);     codecha.surveyOpinion = document.getElementById(&quot;codcha_survey_opinion_area&quot;);     codecha.surveySubmit.onclick = codecha.callbacks.sendSurvey; };  codecha.CORCSRequest = function (url) {     var xhr = new XMLHttpRequest();      if (&quot;withCredentials&quot; in xhr) {         xhr.open(&quot;POST&quot;, url, true);     } else if (typeof XDomainRequest != &quot;undefined&quot;) {         xhr = new XDomainRequest();         xhr.open(&quot;POST&quot;, url);     } else {         xhr = null;     }      xhr.onload = function() { eval(this.responseText); };      xhr.onerror = function() {         alert(&quot;Error!&quot;);         codecha.enable();     };      xhr.setRequestHeader(&quot;Content-type&quot;, &quot;application\/x-www-form-urlencoded&quot;);      return xhr; };  codecha.init = function() {     document.write(             &quot;&lt;input type=\\&quot;hidden\\&quot; id=\\&quot;&quot; + this.fieldPrefix + &quot;challenge_field\\&quot; \/name=\\&quot;&quot; + this.fieldPrefix + &quot;challenge_field\\&quot; \/&gt;&quot;,             &quot;&lt;input type=\\&quot;hidden\\&quot; id=\\&quot;&quot; + this.fieldPrefix + &quot;response_field\\&quot; name=\\&quot;&quot; + this.fieldPrefix + &quot;response_field\\&quot; \/&gt;&quot;,             &quot;&lt;div id=\\&quot;codecha_widget\\&quot;&gt;&quot;,                 &quot;&lt;div id=\\&quot;codecha_error_overlay\\&quot;&gt;&quot;,                     &quot;&lt;a href=\\&quot;#\\&quot; id=\\&quot;codecha_error_overlay_hide\\&quot;&gt;hide&lt;\/a&gt;&quot;,                     &quot;&lt;div id=\\&quot;codecha_error_message\\&quot;&gt;&lt;\/div&gt;&quot;,                 &quot;&lt;\/div&gt;&quot;,                 &quot;&lt;div id=\\&quot;codecha_wording\\&quot;&gt;&lt;\/div&gt;&quot;,                 &quot;&lt;div id=\\&quot;codecha_code_area_top\\&quot;&gt;&lt;\/div&gt;&quot;,                 &quot;&lt;textarea name=\\&quot;codecha_code_area\\&quot; id=\\&quot;codecha_code_area\\&quot;&gt;&quot;,                 &quot;&lt;\/textarea&gt;&quot;,                 &quot;&lt;div id=\\&quot;codecha_code_area_bottom\\&quot;&gt;&lt;\/div&gt;&quot;,                 &quot;&lt;div id=\\&quot;codecha_bottom_container\\&quot;&gt;&quot;,                                              &quot;&lt;a title=\\&quot;click to learn more\\&quot; href=\\&quot;&quot; + codecha.base_url + &quot;\/about\\&quot; target=\\&quot;_blank\\&quot; id=\\&quot;codecha_about\\&quot;&gt;Codecha&lt;\/a&gt;&quot;,                                          &quot;&lt;div id=\\&quot;codecha_bottom\\&quot;&gt;&quot;,                         &quot;&lt;span id=\\&quot;codecha_spinner\\&quot;&gt;&quot;,                             &quot;&lt;span id=\\&quot;codecha_status\\&quot;&gt;waiting&lt;\/span&gt;&quot;,                             &quot;&lt;img alt=\\&quot;spinner\\&quot; src=\\&quot;&quot; + codecha.base_url + codecha.spinner_path + &quot;\\&quot; \/&gt;&quot;,                         &quot;&lt;\/span&gt;&quot;,                         &quot;&lt;select id=\\&quot;codecha_language_selector\\&quot;&gt;&quot;,                                                      &quot;&lt;option value=\\&quot;c\\&quot; &gt;C\/C++&lt;\/option&gt;&quot;,                                                      &quot;&lt;option value=\\&quot;java\\&quot; &gt;Java&lt;\/option&gt;&quot;,                                                      &quot;&lt;option value=\\&quot;python\\&quot; &gt;Python&lt;\/option&gt;&quot;,                                                      &quot;&lt;option value=\\&quot;ruby\\&quot; &gt;Ruby&lt;\/option&gt;&quot;,                                                      &quot;&lt;option value=\\&quot;php\\&quot;  selected &gt;PHP&lt;\/option&gt;&quot;,                                                      &quot;&lt;option value=\\&quot;haskell\\&quot; &gt;Haskell&lt;\/option&gt;&quot;,                                                  &quot;&lt;\/select&gt;&quot;,                         &quot;&lt;input type=\\&quot;submit\\&quot; class=\\&quot;codecha_button\\&quot; name=\\&quot;codecha_change_challenge\\&quot; id=\\&quot;codecha_change_challenge\\&quot; title=\\&quot;request new challenge\\&quot; value=\\&quot;change lang\\&quot;\/&gt;&quot;,                         &quot;&lt;input type=\\&quot;submit\\&quot; class=\\&quot;codecha_button\\&quot; name=\\&quot;codecha_code_submit_button\\&quot; id=\\&quot;codecha_code_submit_button\\&quot; value=\\&quot;VERIFY\\&quot;\/&gt;&quot;,                     &quot;&lt;\/div&gt;&quot;,                 &quot;&lt;\/div&gt;&quot;,             &quot;&lt;\/div&gt;&quot;,                          &quot;&lt;div id=\\&quot;codecha_recaptcha\\&quot;&gt;&quot;,                          &quot;&lt;\/div&gt;&quot;         );      this.mainDiv = document.getElementById(&quot;codecha_widget&quot;);     this.codeArea = document.getElementById(&quot;codecha_code_area&quot;);     this.codeAreaTop = document.getElementById(&quot;codecha_code_area_top&quot;);     this.codeAreaBottom = document.getElementById(&quot;codecha_code_area_bottom&quot;);     this.wordingDiv = document.getElementById(&quot;codecha_wording&quot;);     this.errorOverlayDiv = document.getElementById(&quot;codecha_error_overlay&quot;);     this.errorMessageDiv = document.getElementById(&quot;codecha_error_message&quot;);     this.errorHide = document.getElementById(&quot;codecha_error_overlay_hide&quot;);     this.button = document.getElementById(&quot;codecha_code_submit_button&quot;);     this.spinner = document.getElementById(&quot;codecha_spinner&quot;);     this.statusSpan = document.getElementById(&quot;codecha_status&quot;);     this.languageSelector = document.getElementById(&quot;codecha_language_selector&quot;);     this.recaptchaDiv = document.getElementById(&quot;codecha_recaptcha&quot;);            this.changeChallenge = document.getElementById(&quot;codecha_change_challenge&quot;);      this.changeChallenge.onclick = codecha.callbacks.choseLanguage;     this.button.onclick = codecha.callbacks.codeSubmit;     this.errorHide.onclick = codecha.callbacks.hideErrorOverlay;     this.codeArea.onkeydown = codecha.callbacks.textAreaKeyPress;            this.errorOverlayDiv.hidden = true;     this.spinner.hidden = true;     this.languageSelector.hidden = true;     this.languageSelector.style.display = 'none';                         this.inject_css();           this.enable();      codecha.setChallenge(&quot;d847842d3225459582722c8695ef8523&quot;, &quot;PHP&quot;, &quot;For given numbers \\u0022a\\u0022 and \\u0022b\\u0022 write a function named \\u0022lessab\\u0022 that returns the value \\u00221\\u0022 if \\u0022a\\u0022 is less than \\u0022b\\u0022, and returns the value \\u00220\\u0022 otherwise.\\u000A&quot;,             &quot;function lessab($a,$b) {\\u000A&quot;,             &quot;# put your code here\\u000A&quot;,             &quot;\\u000A}\\u000A&quot;); };  codecha.init(); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0441\u043f\u043e\u0439\u043b\u0435\u0440, \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Ctrl+F \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u00abcodecha.init\u00bb. \u0414\u0430-\u0434\u0430, \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0434\u0430. \u041c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 <a href=\"http:\/\/codecha.org\/api\/challenge?k=e37ea65c651a4eada4d5d4e97ae92d90&amp;survey\">\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/a>. \u042d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e HTML-\u043a\u043e\u0434 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <i>document.write<\/i>. \u0414\u0430\u0436\u0435 \u043d\u0435 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0439\u0442\u0435 \u043c\u0435\u043d\u044f, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u043e\u0445\u043e\u0433\u043e.<\/p>\n<p>  \u041d\u043e \u0438 \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435! (\u0441) \u0440\u0435\u043a\u043b\u0430\u043c\u0430 \u0447\u0443\u0434\u043e-\u043f\u0440\u0438\u0431\u043e\u0440\u043e\u0432<\/p>\n<p>  \u041a\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043c\u0435\u043d\u0430 \u044f\u0437\u044b\u043a\u0430? \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441, \u0430 \u043f\u043e\u0442\u043e\u043c\u2026 \u0431\u0430\u0440\u0430\u0431\u0430\u043d\u043d\u0430\u044f \u0434\u0440\u043e\u0431\u044c\u2026<\/p>\n<pre><code class=\"javascript\">xhr.onload = function() { eval(this.responseText); }; <\/code><\/pre>\n<p>  \u041e, \u0434\u0430! \u0422\u0443\u0442 \u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c, \u043d\u043e \u044f \u0432\u0441\u0435 \u0436\u0435 \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0442\u0443\u0441 \u0434\u043e \u043a\u043e\u043d\u0446\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0432\u043e\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043d\u0430\u0434 Codecha. \u041d\u0435 \u0431\u0443\u0434\u0443 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u0433\u043b\u0430\u0433\u043e\u043b\u044c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u0440\u0430\u0437\u0443 \u043a\u043e\u0434 \u0441 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u0418\u0442\u0430\u043a, HTML \u0432\u0438\u0434\u0436\u0435\u0442\u0430:<\/p>\n<pre><code class=\"html\">&lt;div id=&quot;captcha&quot; class=&quot;codechaContainer&quot;&gt;     &lt;input type=&quot;hidden&quot; id=&quot;codecha_public_key&quot; value=&quot;PUBLIC_KEY&quot; \/&gt;     &lt;input type=&quot;hidden&quot; id=&quot;codecha_challenge_field&quot; name=&quot;codecha_challenge_field&quot; value=&quot;CHALLENGE&quot; \/&gt;     &lt;input type=&quot;hidden&quot; id=&quot;codecha_response_field&quot; name=&quot;codecha_response_field&quot; \/&gt;     &lt;div id=&quot;codecha_ready_widget&quot; style=&quot;display: none;&quot;&gt;&lt;strong&gt;Challenge completed! You may proceed.&lt;\/strong&gt;&lt;\/div&gt;     &lt;div id=&quot;codecha_widget&quot;&gt;         &lt;div id=&quot;codecha_error_overlay&quot; hidden=&quot;true&quot;&gt;             &lt;a id=&quot;codecha_error_overlay_hide&quot; href=&quot;javascript:void(0);&quot; onclick=&quot;codecha.hideErrorOverlay();&quot;&gt;hide&lt;\/a&gt;             &lt;div id=&quot;codecha_error_message&quot;&gt;&lt;\/div&gt;         &lt;\/div&gt;         &lt;div id=&quot;codecha_wording&quot;&gt;&lt;\/div&gt;         &lt;div id=&quot;codecha_code_area_top&quot;&gt;&lt;\/div&gt;         &lt;textarea id=&quot;codecha_code_area&quot; name=&quot;codecha_code_area&quot;&gt;&lt;\/textarea&gt;         &lt;div id=&quot;codecha_code_area_bottom&quot;&gt;&lt;\/div&gt;         &lt;div id=&quot;codecha_bottom_container&quot;&gt;             &lt;a title=&quot;click to learn more&quot; href=&quot;\/\/codecha.org\/about&quot; target=&quot;_blank&quot; id=&quot;codecha_about&quot;&gt;Codecha&lt;\/a&gt;             &lt;div id=&quot;codecha_bottom&quot;&gt;                 &lt;span id=&quot;codecha_spinner&quot; hidden=&quot;true&quot;&gt;                     &lt;span id=&quot;codecha_status&quot;&gt;waiting&lt;\/span&gt;&lt;img src=&quot;\/\/codecha.org\/static\/ajax-loader.gif&quot; \/&gt;                 &lt;\/span&gt;                 &lt;select id=&quot;codecha_language_selector&quot; hidden=&quot;true&quot; style=&quot;display: none;&quot;&gt;                     &lt;option value=&quot;c&quot; selected=&quot;true&quot;&gt;C\/C++&lt;\/option&gt;                     &lt;option value=&quot;java&quot;&gt;Java&lt;\/option&gt;                     &lt;option value=&quot;python&quot;&gt;Python&lt;\/option&gt;                     &lt;option value=&quot;ruby&quot;&gt;Ruby&lt;\/option&gt;                     &lt;option value=&quot;php&quot;&gt;PHP&lt;\/option&gt;                     &lt;option value=&quot;haskell&quot;&gt;Haskell&lt;\/option&gt;                 &lt;\/select&gt;                 &lt;input type=&quot;submit&quot; class=&quot;codecha_button&quot; name=&quot;codecha_change_challenge&quot;                        id=&quot;codecha_change_challenge&quot; title=&quot;request new challenge&quot; value=&quot;change lang&quot;                        onclick=&quot;codecha.chooseLanguage(); return false;&quot; \/&gt;                 &lt;input type=&quot;submit&quot; class=&quot;codecha_button&quot; name=&quot;codecha_code_submit_button&quot;                        id=&quot;codecha_code_submit_button&quot; value=&quot;VERIFY&quot;                        onclick=&quot;codecha.codeSubmit(); return false;&quot; \/&gt;             &lt;\/div&gt;         &lt;\/div&gt;     &lt;\/div&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u041a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"javascript\">var codecha = {};  \/\/\u0412\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438  function id(_id) {     return document.getElementById(_id); }  function node(type, text) {     if (typeof type != &quot;string&quot;)         return null;     type = type.toUpperCase();     return (&quot;TEXT&quot; == type) ? document.createTextNode(text ? text : &quot;&quot;) : document.createElement(type); };  function post(action, data) {     return $.ajax(action, {         type: &quot;POST&quot;,         data: data,         dataType: &quot;text&quot;     }); };  codecha.mustRequestNewChallenge = false;  codecha.serialize = function(obj) {     var array = [];     for (key in obj)         array[array.length] = encodeURIComponent(key) + &quot;=&quot; + encodeURIComponent(obj[key]);     var result = array.join(&quot;&&quot;);     result = result.replace(\/%20\/g, &quot;+&quot;);     return result; };  codecha.escape = function(str) {     var div = node(&quot;div&quot;);     div.appendChild(node(&quot;text&quot;, str));     return div.innerHTML; };  codecha.enable = function() {     id(&quot;codecha_code_submit_button&quot;).disabled = false;     id(&quot;codecha_change_challenge&quot;).disabled = false;     id(&quot;codecha_code_area&quot;).disabled = false;     id(&quot;codecha_spinner&quot;).hidden = true; };  codecha.disable = function() {     id(&quot;codecha_code_submit_button&quot;).disabled = true;     id(&quot;codecha_change_challenge&quot;).disabled = true;     id(&quot;codecha_code_area&quot;).disabled = true;     id(&quot;codecha_spinner&quot;).hidden = false; };  codecha.hideErrorOverlay = function() {     id(&quot;codecha_error_overlay&quot;).hidden = true; }  codecha.setStatus = function(state) {     id(&quot;codecha_status&quot;).innerHTML = state; };  codecha.updateState = function() {     post(&quot;\/\/codecha.org\/api\/state&quot;,         codecha.serialize({ 'challenge': id(&quot;codecha_challenge_field&quot;).value })).then(function(response) {         var match = \/codecha\\.response\\s*\\=\\s&quot;([^&quot;]+)&quot;\/gi.exec(response);         if (match) {             codecha.mustRequestNewChallenge = true;             id(&quot;codecha_response_field&quot;).value = match[1];             id(&quot;codecha_widget&quot;).style.display = &quot;none&quot;;             id(&quot;codecha_ready_widget&quot;).style.display = &quot;&quot;;         } else {             eval(response.replace(&quot;.callbacks&quot;, &quot;&quot;));         }     }).catch(function(err) {         console.log(err);     }); };  codecha.showErrorMessage = function(message) {     id(&quot;codecha_error_message&quot;).innerHTML = message;     id(&quot;codecha_error_overlay&quot;).hidden = false; };  codecha.setChallenge = function(uuid, langName, wording, top, sampleCode, bottom) {     id(&quot;codecha_challenge_field&quot;).value = uuid;     id(&quot;codecha_wording&quot;).innerHTML = &quot;&lt;strong&gt;&quot; + langName + &quot;:&lt;\/strong&gt; &quot; + wording;     id(&quot;codecha_code_area_top&quot;).innerHTML = &quot;&lt;pre&gt;\\n&quot;+this.escape(top)+&quot;&lt;\/pre&gt;&quot;;     id(&quot;codecha_code_area&quot;).value = sampleCode;     id(&quot;codecha_code_area_bottom&quot;).innerHTML = codecha.escape(bottom);     id(&quot;codecha_code_area_top&quot;).hidden = (top.length &lt;= 0);     id(&quot;codecha_code_area_bottom&quot;).hidden = (bottom.length &lt;= 0); };  codecha.choseLanguage = function() {     id(&quot;codecha_language_selector&quot;).hidden = false;     id(&quot;codecha_language_selector&quot;).style.display = &quot;&quot;;     id(&quot;codecha_change_challenge&quot;).value = &quot;\\u2713&quot;;     id(&quot;codecha_code_submit_button&quot;).disabled = true;     id(&quot;codecha_change_challenge&quot;).onclick = codecha.requestNewChallenge;     return false; };  codecha.requestNewChallenge = function() {     codecha.disable();     codecha.setStatus(&quot;waiting&quot;);     var select = id(&quot;codecha_language_selector&quot;);     select.hidden = true;     select.style.display = &quot;none&quot;;     id(&quot;codecha_change_challenge&quot;).value = &quot;change lang&quot;;     id(&quot;codecha_change_challenge&quot;).onclick = codecha.choseLanguage;     id(&quot;codecha_response_field&quot;).value = &quot;&quot;;     var p;     if (!codecha.mustRequestNewChallenge) {         p = Promise.resolve();     } else {         p = Promise.resolve().then(function() {             return $.getJSON(&quot;\/api\/codechaChallenge.json&quot;);         }).then(function(model) {             codecha.mustRequestNewChallenge = false;             id(&quot;codecha_challenge_field&quot;).value = model;             return Promise.resolve();         });     }     p.then(function() {         var params = {             &quot;challenge&quot;: id(&quot;codecha_challenge_field&quot;).value,             &quot;k&quot;: id(&quot;codecha_public_key&quot;).value,             &quot;lang&quot;: select.options[select.selectedIndex].value         };         return post(&quot;\/\/codecha.org\/api\/change&quot;, codecha.serialize(params));     }).then(function(response) {         eval(response);     }).catch(function(err) {         console.log(err);     });     return false; };  codecha.codeSubmit = function() {     codecha.disable();     var params = {         &quot;challenge&quot;: id(&quot;codecha_challenge_field&quot;).value,         &quot;code&quot;: id(&quot;codecha_code_area&quot;).value     };     post(&quot;\/\/codecha.org\/api\/code&quot;, codecha.serialize(params)).then(function(response) {         codecha.setStatus(&quot;sending&quot;);         setTimeout(codecha.updateState, 1000);     }).catch(function(err) {         console.log(err);     }); };  (function() {     var link = node(&quot;link&quot;);     link.setAttribute(&quot;rel&quot;, &quot;stylesheet&quot;);     link.setAttribute(&quot;type&quot;, &quot;text\/css&quot;);     link.setAttribute(&quot;href&quot;, &quot;\/\/codecha.org\/static\/widget.css&quot;);     document.querySelector(&quot;head&quot;).appendChild(link);  })();  window.addEventListener(&quot;load&quot;, function load() {     window.removeEventListener(&quot;load&quot;, load, false);     codecha.disable();     codecha.requestNewChallenge(); }, false);  var reloadCaptcha = function() {     codecha.requestNewChallenge();     id(&quot;codecha_widget&quot;).style.display = &quot;&quot;;     id(&quot;codecha_ready_widget&quot;).style.display = &quot;none&quot;; }; <\/code><\/pre>\n<p>  \u0421\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">var requestChallenge = function(req) {     var url = `http:\/\/codecha.org\/api\/challenge?k=PUBLIC_KEY`;     return HTTP.request({         url: url,         timeout: (15 * 1000)     }).then(function(response) {         if (response.status != 200)             return Promise.reject(&quot;Failed to get challenge&quot;);         return response.body.read(&quot;utf8&quot;);     }).then(function(data) {         var match = \/codecha.setChallenge\\(&quot;([^&quot;]+)&quot;\/gi.exec(data.toString());         if (!match)             return Promise.reject(&quot;Captcha server error&quot;);         return Promise.resolve(match[1]);     }); }; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u0442\u043e\u043c\u0443 \u0441\u0430\u043c\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0443, \u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u043b\u0435\u043d\u044f\u0435\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0434\u0430\u043d\u0438\u044f. \u0417\u0430\u0442\u0435\u043c \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432 HTML-\u0448\u0430\u0431\u043b\u043e\u043d \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043e\u0442\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<p>  \u041a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 \u0437\u0430\u0434\u0430\u043d\u0438\u044f. \u0412\u0430\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435, \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0432\u0438\u0434\u0436\u0435\u0442. \u041d\u043e \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u0435\u0434\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 Codecha \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u0435\u0433\u043e (\u0442\u0443\u0442 \u0432\u0441\u0435 \u043f\u043e\u0447\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0436\u0435\u0442\u0443), \u043c\u044b \u041d\u0415 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u044f\u0447\u0435\u043c \u0438\u0445. \u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 AJAX-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>reloadCaptcha<\/i>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0435\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043d\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Codecha \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442 \u0432\u0438\u0434\u0436\u0435\u0442 \u0437\u0430\u043d\u043e\u0432\u043e. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0435\u0431\u044f \u0441\u0443\u0445\u043e \u0438 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0434\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438:<\/p>\n<ol>\n<li>\u041d\u0438\u043a\u043e\u0433\u0434\u0430, \u041d\u0418\u041a\u041e\u0413\u0414\u0410 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 eval \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u042d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c API \u043e\u0442 \u0438\u0445 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/li>\n<li>\u0414\u0443\u043c\u0430\u0439\u0442\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0430\u0448 \u043f\u0440\u043e\u0434\u0443\u043a\u0442. \u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 (\u0445\u043e\u0442\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0435\u0431\u0435 \u043e\u0431\u044b\u0434\u0435\u043d\u043d\u044b\u0439). \u0421\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c API \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u044b\u043c \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445.<\/li>\n<li>\u041d\u0435 \u0437\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439, \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439, \u043f\u043e\u0440\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043f\u043e\u0440\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u0438, \u043d\u043e \u043d\u0438 \u043e\u0442 \u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u0449\u0438\u0442\u0438\u0442.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0443\u0436 \u0440\u0435\u0448\u0438\u043b\u0438 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c API \u043e\u0442 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430, \u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044e. \u0411\u0435\u0437 \u043d\u0435\u0435 \u044d\u0442\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u0442\u0430 \u0441\u0432\u043e\u0435\u0433\u043e \u0438 \u0447\u0443\u0436\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/li>\n<\/ol>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/272129\/\"> http:\/\/habrahabr.ru\/post\/272129\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0430\u0439\u0442\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"http:\/\/codecha.org\/\">Codecha<\/a> \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0441\u043a\u0443\u044e \u043a\u0430\u043f\u0447\u0443. \u042d\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u0430\u043f\u0447\u0430, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fa2\/202\/9e2\/fa22029e296cd9317f0cae0d98fdc2a4.png\" alt=\"\u041a\u0414\u041f\u0412 \u2014  \u0432\u0438\u0434\u0436\u0435\u0442 \u044d\u0442\u043e\u0439 \u0441\u0430\u043c\u043e\u0439 \u043a\u0430\u043f\u0447\u0438\"\/><\/p>\n<p>  \u041e\u043d\u0430 \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u043e\u043b\u044c \u0436\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0431\u043e\u0442\u043e\u0432, \u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Google reCAPTCHA (\u043d\u0430\u0431\u043e\u0440 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0438 \u0438\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0440\u0435\u0448\u0430\u0442\u044c, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b), \u043d\u043e \u0437\u0430\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u043e\u0442\u0438\u0432 \u043d\u0435-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 (\u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0444\u043e\u0440\u0443\u043c\u043e\u0432 \u0442\u043e\u043b\u043f\u044b \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432, \u043f\u0440\u043e\u0441\u044f\u0449\u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0445 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u2014 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0445\u0443\u0436\u0435 \u0441\u043f\u0430\u043c-\u0431\u043e\u0442\u043e\u0432). \u041d\u043e \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043d\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0432 \u0445\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Codecha, \u2014 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u0439 API \u043a\u0430\u043a \u0441\u0430\u043c\u043e\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043a\u0430\u043f\u0447\u0438, \u0442\u0430\u043a \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-269455","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/269455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=269455"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/269455\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=269455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=269455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=269455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}