{"id":284313,"date":"2017-04-02T21:35:02","date_gmt":"2017-04-02T17:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=284313"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=284313","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u043e\u0442\u0430 \u0434\u043b\u044f Skype. \u0428\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c, \u0447\u0435\u0440\u0435\u0437 REST API \u0438 \u043d\u0430 Python"},"content":{"rendered":"<p> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a2a\/559\/31a\/a2a55931a62040b8854ad542048817c5.jpg\"\/><br \/>  <i>\u041a\u043e\u0433\u0434\u0430 \u0438\u0449\u0435\u0448\u044c long-polling \u0432 Skype API<\/i> <\/p>\n<p>  \u0413\u043e\u0434 \u043d\u0430\u0437\u0430\u0434 Microsoft <a href=\"https:\/\/geektimes.ru\/post\/273618\/\">\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430<\/a> \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u043e\u0432 \u043f\u043e\u0434 Skype. \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0441 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438, \u043a\u0430\u043a \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c\u0435, \u043e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e. <\/p>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u0434\u043b\u044f Skype. \u0418 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u043f\u043e\u0434\u044b\u043c\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 ( <a href=\"https:\/\/habrahabr.ru\/post\/281296\/\">\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440<\/a>), \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e step-by-step \u0433\u0430\u0439\u0434\u0430 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 REST API. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0431\u043e\u0442 \u0434\u043b\u044f \u0441\u043a\u0430\u0439\u043f\u0430 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0442\u044c \u043e \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u0430\u043c\u043d\u044f\u0445 \u0438 \u0437\u043d\u0430\u0442\u044c \u0433\u0434\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0443\u0441\u0432\u043e\u0438\u0442\u044c: \u041d\u0435\u0442 \u0432\u0435\u0431 \u043f\u043e\u043b\u043b\u0438\u043d\u0433\u0430. \u0415\u0441\u043b\u0438 \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c \u043d\u0430 \u0432\u044b\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u043e\u043d\u0433-\u043f\u043e\u043b\u043b\u0438\u043d\u0433 \u0438 \u0432\u0435\u0431\u0445\u0443\u043a\u0438, \u0442\u043e \u0441\u043a\u0430\u0439\u043f \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0431\u0445\u0443\u043a\u0430\u043c\u0438. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2013 \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0441\u043a\u0430\u0439\u043f\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e https, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430. \u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f, \u0445\u043e\u0441\u0442\u0438\u043d\u0433, \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u043c. <\/p>\n<p>  <b>\u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c? <\/b><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0433\u043e\u043b\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 ( \u0443 \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0431\u044b\u043b Raspberry Pi, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u043e\u0442\u0430, \u043d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u0430\u043c\u0430\u0437\u043e\u043d\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 ). \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e. \u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/www.freenom.com\/en\/index.html?lang=en\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0430 \u044d\u0442\u043e \u0438\u043c\u044f. \u042d\u0442\u043e \u043b\u0435\u0433\u0447\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/certbot.eff.org\/\">Let\u2019s Encrypt<\/a>. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u043f\u0446\u0438\u044e standalone server \u2013 certbot \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u044b \u0432\u043b\u0430\u0434\u0435\u0435\u0442\u0435 \u044d\u0442\u0438\u043c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0443 \u0432\u0430\u0441 \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0432 \u043f\u0430\u043f\u043a\u0435 \u201c\/etc\/letsencrypt\/archive\u201d. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043e \u043a \u0440\u0430\u0431\u043e\u0442\u0435, \u043d\u0430\u0447\u043d\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u0442\u0430. <br \/>  1. \u041c\u043d\u043e\u0433\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/habrahabr.ru\/post\/281296\/\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0434\u0432\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u0430: \u0412\u043e\u0442 <a href=\"https:\/\/apps.dev.microsoft.com\/#\/appList\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438 <a href=\"https:\/\/developer.microsoft.com\/en-us\/skype\/bots\/manage\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0431\u043e\u0442\u0430. \u041f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c endpoint, \u043a\u0443\u0434\u0430 Microsoft \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u044b\u043b\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041e\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u043e\u043c \u0436\u0435 \u0432\u0438\u0434\u0435, \u043a\u0430\u043a \u0438 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u041f\u043e\u0441\u043b\u0435 endpoint\u2019a \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0440\u0442, \u0442\u043e\u0433\u0434\u0430 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a: \u201chttps:\/\/endpoint_url:port\u201d \u041f\u043e\u0441\u043b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c, \u0438 \u044d\u0442\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c: application_id ( \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0431\u043e\u0442\u0430 ) \u0438 \u043f\u0430\u0440\u043e\u043b\u044c ( \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e ). <br \/>  2. \u0412\u044b \u0435\u0449\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0440\u043e \u0432\u0435\u0431\u0445\u0443\u043a\u0438? \u041d\u0430\u0441\u0442\u0430\u043b\u0430 \u043f\u043e\u0440\u0430 \u043f\u043e\u0434\u044b\u043c\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b. \u041d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0444\u043b\u0430\u0441\u043a. \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 ( \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 ), \u0438 \u043d\u0430\u0447\u043d\u0435\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043a\u0435\u043d:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">FLASK = Flask(__name__) APP_ID = '' PASSWORD = '' # \u0441\u0435\u043a\u0440\u0435\u0442 \u043e\u0442 \u0431\u043e\u0442\u0430 context =('fullchain.pem', 'privkey.pem') # \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043b\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b certbot TOKEN = {} def get_token():     global TOKEN     url = 'https:\/\/login.microsoftonline.com\/botframework.com\/oauth2\/v2.0\/token'     payload = {'grant_type': 'client_credentials',                'client_id': APP_ID,                'client_secret': PASSWORD,                'scope': 'https:\/\/api.botframework.com\/.default',               }     token = requests.post('https:\/\/login.microsoftonline.com\/botframework.com\/oauth2\/v2.0\/token', data=payload).content     TOKEN = json.loads(str(token)[2:-1])     return json.loads(str(token)[2:-1]) def send_token_to_connector(token):     url = 'https:\/\/groupme.botframework.com\/v3\/conversations'     headers = {'Authorization': 'Bearer ' + token}     r = requests.post(url, headers=headers)     return r def get_and_verify_token():     global TOKEN     while True:         get_token()         send_token_to_connector(TOKEN['access_token'])         time.sleep(TOKEN['expires_in']*0.9)<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  3. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">@FLASK.route('\/', methods=['GET', 'POST']) def handle():     data = request.get_json()     talk_id = data['conversation']['id']     msg = {         &quot;type&quot;: &quot;message&quot;,         &quot;from&quot;: {                 &quot;id&quot;: APP_ID,                 &quot;name&quot;: &quot;habraechobot&quot;             },         &quot;conversation&quot;: {             &quot;id&quot;: talk_id,         },         &quot;text&quot;: data['text'],     }     url = data['serviceUrl'] + '\/v3\/conversations\/{}\/activities\/'.format(data['conversation']['id'])     headers = {'Authorization': 'Bearer ' + TOKEN['access_token'],                'content-type': 'application\/json; charset=utf8'}     r = requests.post(url, headers=headers, data=json.dumps(msg))     return 'success'<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  4. \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440:   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">if __name__ == '__main__':     thread = Thread( target=get_and_verify_token )     thread.start()     FLASK.run(host='0.0.0.0', port=8080, ssl_context=context) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435 \u2013 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u043e\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/github.com\/AverageS\/SecureBot\/blob\/master\/echo_bot.py\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0438 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u043a\u043e\u043c\u0443-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u0438\u043b\u044b.<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/325456\/\"> https:\/\/habrahabr.ru\/post\/325456\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a2a\/559\/31a\/a2a55931a62040b8854ad542048817c5.jpg\"\/><br \/>  <i>\u041a\u043e\u0433\u0434\u0430 \u0438\u0449\u0435\u0448\u044c long-polling \u0432 Skype API<\/i> <\/p>\n<p>  \u0413\u043e\u0434 \u043d\u0430\u0437\u0430\u0434 Microsoft <a href=\"https:\/\/geektimes.ru\/post\/273618\/\">\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430<\/a> \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u043e\u0432 \u043f\u043e\u0434 Skype. \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0441 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438, \u043a\u0430\u043a \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c\u0435, \u043e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e. <\/p>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u0434\u043b\u044f Skype. \u0418 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u043f\u043e\u0434\u044b\u043c\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 ( <a href=\"https:\/\/habrahabr.ru\/post\/281296\/\">\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440<\/a>), \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e step-by-step \u0433\u0430\u0439\u0434\u0430 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 REST API.   <\/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-284313","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/284313","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=284313"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/284313\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=284313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=284313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=284313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}