{"id":275732,"date":"2016-03-09T13:03:02","date_gmt":"2016-03-09T10:03:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=275732"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=275732","title":{"rendered":"\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Telegram-\u0431\u043e\u0442\u0430"},"content":{"rendered":"<br \/>\n<h1>\u041e \u0447\u0451\u043c \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f?<\/h1>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 (Firefox) \u0438 Python \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e Telegram-\u0431\u043e\u0442\u0430 \u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>  \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0442\u0435\u043c, \u043a\u0442\u043e \u043d\u0430\u0441\u043b\u044b\u0448\u0430\u043d \u043e Telegram&#8217;\u043d\u044b\u0445 \u0431\u043e\u0442\u0430\u0445, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a \u043a \u043d\u0438\u043c \u043f\u043e\u0434\u0441\u0442\u0443\u043f\u0438\u0442\u044c\u0441\u044f \u0438 \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043d\u0438\u0435 Python.<\/p>\n<p>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/imgs.xkcd.com\/comics\/twitter_bot.png\" alt=\"writing a twitter bot\" title=\"PYTHON FLAG ENABLE THREE LAWS\"\/><br \/>  (<em><a href=\"http:\/\/xkcd.com\/1646\/\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b<\/a><\/em>)<\/p>\n<h1>TL;DR<\/h1>\n<p>  \u0418\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435:<\/p>\n<p>  1. \u041a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435?<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u0432\u0435\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><em>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f web tool \u0432\u0430\u0448\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.<\/em><\/p><\/div>\n<\/div>\n<p>  2. \u041a\u0430\u043a \u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python?<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u0432\u0435\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><em>\u0423\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u0431\u0451\u0440\u0442\u043a\u043e\u0439 \u043d\u0430\u0434 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c <a href=\"https:\/\/docs.python.org\/2\/library\/urllib2.html\"><code>urllib2<\/code><\/a> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"http:\/\/docs.python-requests.org\/en\/master\/\"><code>requests<\/code><\/a>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435: <a href=\"https:\/\/habrahabr.ru\/post\/126262\/\">&quot;\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432&quot;<\/a>.<\/em><\/p><\/div>\n<\/div>\n<p>  3. \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u043d\u0430 Python?<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u0432\u0435\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><em>\u041f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <a href=\"https:\/\/github.com\/python-telegram-bot\/python-telegram-bot\/\"><code>python-telegram-bot<\/code><\/a>. \u041f\u043e\u043a\u0430 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0430\u0441\u044c.<\/em><\/p><\/div>\n<\/div>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h1>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h1>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D1%82%D1%80%D0%B5%D0%BB%D0%BA%D0%B0_%28%D0%B5%D0%B4%D0%B8%D0%BD%D0%B0%D1%8F_%D1%82%D1%80%D0%B0%D0%BD%D1%81%D0%BF%D0%BE%D1%80%D1%82%D0%BD%D0%B0%D1%8F_%D0%BA%D0%B0%D1%80%D1%82%D0%B0%29\">\u0435\u0434\u0438\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0430 &quot;\u0421\u0442\u0440\u0435\u043b\u043a\u0430&quot;<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0430 \u043f\u043e\u0435\u0437\u0434\u043a\u0430\u0445 \u0438\u0437 \u041c\u043e\u0441\u043a\u0432\u044b \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u0437\u0434\u0430 \u043f\u0440\u0438 \u043e\u043f\u043b\u0430\u0442\u0435 \u043d\u0430\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 20-30% \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0438 \u043e\u043f\u043b\u0430\u0442\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u043e\u0439. <\/p>\n<p>  \u0423\u0437\u043d\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043d\u0430 \u0441\u0447\u0451\u0442\u0435 \u043f\u0440\u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043e\u043f\u043b\u0430\u0442\u044b \u043d\u0435\u043b\u044c\u0437\u044f. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0438\u0437-\u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0443 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433\u043e\u0432\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0441\u0447\u0451\u0442\u0430 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0441\u0430\u0439\u0442 <a href=\"http:\/\/strelkacard.ru\">http:\/\/strelkacard.ru<\/a> \u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0434\u043e Android 6 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435: \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043b\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u043b\u0435\u0442\u0430\u0442\u044c \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435. \u041d\u0435\u043c\u0430\u043b\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u0447\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=ru.bytemax.vezdehod\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/a> \u0432 Google Play. \u041d\u043e \u0432\u043e\u0437 \u0438 \u043d\u044b\u043d\u0435 \u0442\u0430\u043c.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Screenshot \u043e\u0442\u0437\u044b\u0432\u043e\u0432 \u043d\u0430 5 \u043c\u0430\u0440\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a18\/d55\/656\/a18d55656e6e416da1ee07df1f9ee8b5.png\" alt=\"\u043e\u0442\u0437\u044b\u0432\u044b\" title=\"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u0440\u0435\u043c\u043b\u044e\u0442\"\/><\/p><\/div>\n<\/div>\n<p>  \u041f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u043f\u043b\u0430\u0442\u044b \u043f\u043e\u0435\u0437\u0434\u043a\u0438. \u0414\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0430\u0439\u0442 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0430.<\/p>\n<p>  \u0412\u043e\u0437\u043d\u0438\u043a \u0432\u043e\u043f\u0440\u043e\u0441: &quot;\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u043a\u0430\u0440\u0442\u044b \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439?&quot;<\/p>\n<h1>\u0418\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b<\/h1>\n<p>  \u0418\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0430 \u043c\u0435\u0441\u0442\u0430, \u043e\u0442\u043a\u0443\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0435 \u043a\u0430\u0440\u0442\u044b:<\/p>\n<ol>\n<li>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/li>\n<li>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442<\/li>\n<\/ol>\n<p>  \u0423\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e. \u0413\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u0435\u0433\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 web-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f plugin \u0434\u043b\u044f Firefox <a href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/firebug\/\">Firebug<\/a>.<\/p>\n<p>  \u0417\u0430\u0439\u0434\u0451\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <a href=\"http:\/\/strelkacard.ru\/\">http:\/\/strelkacard.ru\/<\/a> \u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u043d\u0435\u043b\u044c Firebug. \u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 <code>Net<\/code>. \u0415\u0441\u043b\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u043e\u043c\u0435\u0440 \u043a\u0430\u0440\u0442\u044b \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d0c\/318\/dd6\/d0c318dd65a748fd98c585f7a5cf6e3d.png\" alt=\"Firebug &#39;Net&#39;\"\/><\/p>\n<p>  \u0429\u0451\u043b\u043a\u043d\u0435\u043c \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043f\u0443\u043d\u043a\u0442 <code>'Copy as cURL'<\/code>. \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u0431\u0443\u0444\u0444\u0435\u0440\u0435 \u043e\u0431\u043c\u0435\u043d\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b <a href=\"https:\/\/en.wikipedia.org\/wiki\/CURL\"><code>curl<\/code><\/a> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0440\u043e\u0432\u043d\u043e \u0442\u043e\u0442 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u0430\u043a\u043e\u0439 \u0431\u044b\u043b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>curl 'http:\/\/strelkacard.ru\/api\/cards\/status\/?cardnum=12345678901&amp;cardtypeid=3ae427a1-0f17-4524-acb1-a3f50090a8f3' -H 'Accept: application\/json, text\/plain, *\/*' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.5' -H 'Connection: keep-alive' -H 'Host: strelkacard.ru' -H 'Referer: http:\/\/strelkacard.ru\/' -H 'User-Agent: Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko\/20100101 Firefox\/44.0'<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0432\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/JSON\">JSON<\/a>:<\/p>\n<pre><code>{&quot;cardactive&quot;:false,&quot;balance&quot;:100100,&quot;baserate&quot;:3000,&quot;cardblocked&quot;:false,&quot;numoftrips&quot;:0}<\/code><\/pre>\n<p>  \u041e\u0442\u043b\u043e\u0436\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u043f\u043e\u0442\u043e\u043c, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 header&#8217;\u044b, \u043d\u0435 \u0440\u0438\u0441\u043a\u0443\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442. \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b <code>-H<\/code> \u0438 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 GET \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<pre><code>$ curl 'http:\/\/strelkacard.ru\/api\/cards\/status\/?cardnum=12345678901&amp;cardtypeid=3ae427a1-0f17-4524-acb1-a3f50090a8f3' {&quot;cardactive&quot;:false,&quot;balance&quot;:100100,&quot;baserate&quot;:3000,&quot;cardblocked&quot;:false,&quot;numoftrips&quot;:0}<\/code><\/pre>\n<p>  \u041e\u0442\u0432\u0435\u0442 \u0435\u0449\u0451 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c. \u0421\u0440\u0435\u0434\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0435\u0441\u0442\u044c <code>cardnum<\/code>, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u043d\u043e\u043c\u0435\u0440 \u043a\u0430\u0440\u0442\u044b, \u0438 <code>cardtypeid<\/code>, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0442\u0438\u043f \u043a\u0430\u0440\u0442\u044b. \u0415\u0441\u043b\u0438 \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439 \u043d\u0435\u0442, \u0442\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u0430 \u043a\u0430\u0440\u0442\u044b \u043f\u043e\u0434 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0438\u043a\u0430\u043a \u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0438 \u043e\u0442 \u043d\u0435\u0433\u043e:<\/p>\n<pre><code>$ curl 'http:\/\/strelkacard.ru\/api\/cards\/status\/?cardnum=12345678901' {&quot;__all__&quot;:[&quot;\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b&quot;]}<\/code><\/pre>\n<p>  \u041e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043d\u0435 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043b\u0438\u0441\u044c. \u0417\u043d\u0430\u0447\u0438\u0442, \u0442\u0438\u043f \u043a\u0430\u0440\u0442\u044b \u043a\u0430\u043a-\u0442\u043e \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u0430. \u0411\u0435\u0433\u043b\u044b\u0439 \u043e\u0431\u0437\u043e\u0440 js-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432\u044b\u044f\u0432\u0438\u043b \u0444\u0430\u043a\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u043d, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u0440\u0438 \u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<h2>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/h2>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u043d\u0430 \u043e\u0442\u0432\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<pre><code>{&quot;cardactive&quot;:false,&quot;balance&quot;:100100,&quot;baserate&quot;:3000,&quot;cardblocked&quot;:false,&quot;numoftrips&quot;:0}<\/code><\/pre>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u0430\u044f \u043d\u0430\u043c \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u2014 <code>balance<\/code>. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043b\u043e\u0441\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d \u0438 \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u044d\u0442\u0430 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043f\u0435\u0435\u043a.<\/p>\n<h2>\u041e\u0431\u0449\u0430\u0435\u043c\u0441\u044f \u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0439\u0441\u043e\u043c \u0438\u0437 Python<\/h2>\n<p>  <code>curl<\/code> \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0445\u043e\u0440\u043e\u0448, \u043d\u043e \u043d\u0430\u043c \u043c\u0430\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430. \u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043c\u0435\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c. \u042f\u0437\u044b\u043a Python \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 json \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <a href=\"https:\/\/docs.python.org\/2\/library\/json.html\">\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438<\/a>. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0430\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 HTTP <a href=\"https:\/\/docs.python.org\/2\/library\/urllib2.html\"><code>urllib2<\/code><\/a>. \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; import urllib2 &gt;&gt;&gt; f = urllib2.urlopen('http:\/\/strelkacard.ru\/api\/cards\/status\/?cardnum=12345678901&amp;cardtypeid=3ae427a1-0f17-4524-acb1-a3f50090a8f3') &gt;&gt;&gt; print f.read() {&quot;cardactive&quot;:false,&quot;balance&quot;:100100,&quot;baserate&quot;:3000,&quot;cardblocked&quot;:false,&quot;numoftrips&quot;:0}<\/code><\/pre>\n<p>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0445\u043e\u0440\u043e\u0448\u043e. \u041d\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>cardnum<\/code> \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043c\u0435\u043d\u044f\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043f\u043e\u0432\u044b\u0448\u0435 \u0438 \u043d\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"http:\/\/docs.python-requests.org\/en\/master\/\"><code>requests<\/code><\/a> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0451:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; import requests &gt;&gt;&gt; CARD_TYPE_ID = '3ae427a1-0f17-4524-acb1-a3f50090a8f3' &gt;&gt;&gt; card_number='12345678901' &gt;&gt;&gt; payload = {'cardnum':card_number, 'cardtypeid': CARD_TYPE_ID} &gt;&gt;&gt; r = requests.get('http:\/\/strelkacard.ru\/api\/cards\/status\/', params=payload) &gt;&gt;&gt; print &quot;Get info for card %s: %d %s&quot; % (card_number, r.status_code, r.text) Get info for card 12345678901: 200 {&quot;cardactive&quot;:false,&quot;balance&quot;:100100,&quot;baserate&quot;:3000,&quot;cardblocked&quot;:false,&quot;numoftrips&quot;:0}<\/code><\/pre>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <code>requests<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <a href=\"http:\/\/docs.python-requests.org\/en\/master\/user\/quickstart\/#json-response-content\"><code>json()<\/code><\/a> \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f json-formatted \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Python \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; r.json() {u'cardactive': False, u'balance': 100100, u'numoftrips': 0, u'baserate': 3000, u'cardblocked': False} &gt;&gt;&gt; r.json()['balance'] 100100<\/code><\/pre>\n<p>  <\/p>\n<h1>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0432\u043e\u044e \u043e\u0431\u0451\u0440\u0442\u043a\u0443<\/h1>\n<p>  \u041c\u044b \u0443\u0436\u0435 \u0443\u043c\u0435\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043d\u0430\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u043d\u0430 Python. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0435 \u043a\u0430\u0440\u0442\u044b. \u0417\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u0444\u0430\u0439\u043b <code>checker.py<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python import logging import requests  CARD_TYPE_ID = '3ae427a1-0f17-4524-acb1-a3f50090a8f3'  logger = logging.getLogger(__name__)  def get_status(card_number):     payload = {'cardnum':card_number, 'cardtypeid': CARD_TYPE_ID}     r = requests.get('http:\/\/strelkacard.ru\/api\/cards\/status\/', params=payload)     logger.info(&quot;Get info for card %s: %d %s&quot; % (card_number, r.status_code, r.text))     if r.status_code == requests.codes.ok:         return r.json()     raise ValueError(&quot;Can't get info about card with number %s&quot; % card_number)  def get_balance(card_number):     r = get_status(card_number)     return r['balance']\/100.<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0435, \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u0432\u0443\u0445 \u0441\u0442\u0440\u043e\u043a:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; import checker &gt;&gt;&gt; checker.get_balance('12345678901') 1001.0<\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/docs.python.org\/2\/library\/logging.html\"><code>logging<\/code><\/a>. \u0421 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043d\u0430 <a href=\"https:\/\/habrahabr.ru\/post\/144566\/\">\u0425\u0430\u0431\u0440\u0435<\/a>.<\/p>\n<p>  \u0422\u0443\u0442 \u043e\u0442\u043c\u0435\u0447\u0443 \u043b\u0438\u0448\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435:<\/p>\n<pre><code class=\"python\">logging.basicConfig(         format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',         level=logging.INFO)<\/code><\/pre>\n<p>  <\/p>\n<h1>\u041e\u0431\u0451\u0440\u0442\u043a\u0430 \u0435\u0441\u0442\u044c. \u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h1>\n<p>  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u043e\u044f\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0435 \u0441 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0415\u0441\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442\u043e \u0443 \u043d\u0435\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0443 (\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 + \u043a\u043d\u043e\u043f\u043a\u0430) \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0435 \u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u0430\u0440\u0442\u0430\u0445 (\u043a\u043d\u043e\u043f\u043a\u0430 + \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432\u044b\u0432\u043e\u0434\u0430). \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  \u0422\u0440\u0435\u0431\u0443\u0435\u043c\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API Telegram \u0434\u043b\u044f \u0431\u043e\u0442\u043e\u0432.<\/p>\n<h2>\u0421\u043b\u043e\u0436\u043d\u043e \u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u0442\u0430?<\/h2>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0442. \u041d\u0430\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0431\u043e\u0442 \u0443\u043c\u0435\u043b \u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u0435\u0442\u0441\u043a\u0443\u044e \u0431\u0435\u0441\u0435\u0434\u0443. \u041e\u0442 \u043d\u0435\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438 \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438 \u043e \u0431\u043e\u0442\u0430\u0445 Telegram \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0431\u043b\u043e\u0433\u0435: <a href=\"https:\/\/telegram.org\/blog\/bot-revolution\">&quot;Telegram Bot Platform&quot;<\/a>. \u0427\u0442\u043e \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e: \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0432 \u043f\u0430\u0440\u0443 \u043d\u0430\u0436\u0430\u0442\u0438\u0439.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0431\u043e\u0442\u0430<\/h2>\n<p>  <\/p>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u043a\u0435\u043d<\/h3>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u043e\u0432 \u0438 \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/core.telegram.org\/bots\">&quot;Bots: An introduction for developers&quot;<\/a>. \u0422\u0430\u043c \u0436\u0435 \u0435\u0441\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a \u0430\u0432\u0442\u043e\u0440\u0438\u0442\u0435\u0442\u0443 \u0441\u0440\u0435\u0434\u0438 \u0431\u043e\u0442\u043e\u0432: \u0431\u043e\u0442\u0443 <a href=\"https:\/\/telegram.me\/botfather\"><code>@BotFather<\/code><\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/core.telegram.org\/file\/811140934\/1\/tbDSLHSaijc\/fdcc7b6d5fb3354adf\" alt=\"The BotFather\"\/><\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 <code>@BotFather<\/code> \u2014 token \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API. <\/p>\n<h3>\u0418\u0449\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443-\u043e\u0431\u0451\u0440\u0442\u043a\u0443<\/h3>\n<p>  \u041c\u044b \u0443\u0436\u0435 \u043d\u0430\u0447\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python. \u0418 \u0434\u0430\u0436\u0435 \u0443\u043c\u0435\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443. \u041c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 Telegram API. \u041d\u043e \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u044b, \u0442\u043e \u043d\u0430\u0447\u0435\u0440\u043d\u044f\u043a\u0430 \u043a\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u0434\u043e \u043d\u0430\u0441. \u041f\u043e\u0438\u0449\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Telegram bot API. \u041f\u043e\u0438\u0441\u043a [\u0432 \u043b\u044e\u0431\u0438\u043c\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u0435](<a href=\"http:\/\/ddg.gg\/?q=python\">http:\/\/ddg.gg\/?q=python<\/a> telegram bot) \u043f\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u0430\u043c &quot;python telegram bot&quot; \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430-\u043e\u0431\u0451\u0440\u0442\u043a\u0430 <a href=\"https:\/\/pypi.python.org\/pypi\/python-telegram-bot\/\"><code>python-telegram-bot<\/code><\/a>. \u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438: 3.3.<\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435: \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u043e\u0439 \u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 <a href=\"http:\/\/python-telegram-bot.readthedocs.org\/en\/latest\/telegram.dispatcher.html#telegram.dispatcher.Dispatcher.addTelegramCommandHandler\"><code>addTelegramCommandHandler<\/code><\/a> \u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u044b \u0432 <a href=\"https:\/\/pypi.python.org\/pypi\/python-telegram-bot\/\">\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a>.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u043e\u0442\u0430<\/h3>\n<p>  \u041d\u0430\u0448\u0435\u043c\u0443 \u0431\u043e\u0442\u0443 \u0432 \u0435\u0433\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<ol>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u044b \u043f\u043e \u0435\u0451 \u043d\u043e\u043c\u0435\u0440\u0443<\/li>\n<li>\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u044b \u043f\u043e \u0435\u0451 \u043d\u043e\u043c\u0435\u0440\u0443<\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0430\u0445<\/li>\n<\/ol>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u044f\u0434\u043e\u043c \u0441 <code>checker.py<\/code> \u0444\u0430\u0439\u043b <code>strelka_bot.py<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python from telegram import Updater, User import logging import checker  TOKEN = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'  # Enable Logging logging.basicConfig(         format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',         level=logging.INFO) logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG)  # Dictionary to store users by its id users = {}  class UserInfo:     def __init__(self, telegram_user):         self.user = telegram_user         self.cards = {}      def add_card(self, card_number):         card = CardInfo(card_number)         self.cards[card_number] = CardInfo(card_number)  class CardInfo:     def __init__(self, card_number):         self.card_number = card_number      def balance(self):         logger.info(&quot;Getting balance for card %s&quot; % self.card_number)         json = checker.get_status(self.card_number)         return json['balance']\/100.  def log_params(method_name, update):     logger.debug(&quot;Method: %s\\nFrom: %s\\nchat_id: %d\\nText: %s&quot; %                 (method_name,                  update.message.from_user,                  update.message.chat_id,                  update.message.text))  def help(bot, update):     log_params('help', update)     bot.sendMessage(update.message.chat_id         , text=&quot;&quot;&quot;Supported commands: \/help - Show help \/addcard - Add a card to the list of registered cards \/removecard - Remove a card to the list of registered cards \/getcards - Returns balance for all registered cards&quot;&quot;&quot;)  def add_card(bot, update, args):     log_params('add_card', update)     if len(args) != 1:         bot.sendMessage(update.message.chat_id, text=&quot;Usage:\\n\/addcard 1234567890&quot;)         return     card_number = args[0]     telegram_user = update.message.from_user     if not users.has_key(telegram_user.id):         users[telegram_user.id] = UserInfo(telegram_user)      user = users[telegram_user.id]     if not user.cards.has_key(card_number):         user.add_card(card_number)         bot.sendMessage(update.message.chat_id, text=&quot;Card %s successfully added&quot; % (card_number))     else:         bot.sendMessage(update.message.chat_id, text=&quot;Card %s already added. Do nothing&quot; % (card_number))  def remove_card(bot, update, args):     log_params('remove_card', update)     if len(args) != 1:         bot.sendMessage(update.message.chat_id, text=&quot;Usage:\\n\/removecard 1234567890&quot;)         return     card_number = args[0]     telegram_user = update.message.from_user     if not users.has_key(telegram_user.id):         bot.sendMessage(update.message.chat_id, text=&quot;There are no cards registered for you&quot;)         return     user = users[telegram_user.id]     if user.cards.has_key(card_number):         user.cards.pop(card_number)         bot.sendMessage(update.message.chat_id, text=&quot;Card %s successfully removed&quot; % (card_number))     else:         bot.sendMessage(update.message.chat_id, text=&quot;Card %s has not being added. Do nothing&quot; % (card_number))  def get_cards(bot, update):     log_params('get_cards', update)     telegram_user = update.message.from_user     if not users.has_key(telegram_user.id) or len(users[telegram_user.id].cards) == 0:         bot.sendMessage(update.message.chat_id         , text=&quot;There are now saved cards for you. Please use command \/addcard CARD_NUMBER&quot;)         return      user = users[telegram_user.id]     cards = user.cards     response = &quot;&quot;     for card in cards.values():         if len(response) != 0:             response += '\\n'         response += &quot;Card balance for %s: %.2f&quot;%(card.card_number, card.balance())      bot.sendMessage(update.message.chat_id, text=response)  def main():     updater = Updater(TOKEN)     # Get the dispatcher to register handlers     dp = updater.dispatcher      # Add handlers for Telegram messages     dp.addTelegramCommandHandler(&quot;help&quot;, help)     dp.addTelegramCommandHandler(&quot;addcard&quot;, add_card)     dp.addTelegramCommandHandler(&quot;removecard&quot;, remove_card)     dp.addTelegramCommandHandler(&quot;getcards&quot;, get_cards)      updater.start_polling()      updater.idle()  if __name__ == '__main__':     main()<\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>TOKEN<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 <code>@BotFather<\/code>.<\/p>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0431\u043e\u0442\u0430<\/h3>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f <code>strelka_bot.py<\/code> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u0432 \u0436\u0438\u0437\u043d\u044c.<\/p>\n<pre><code>$ python simple_strelka_bot.py  2016-03-06 12:02:11,706 - telegram.dispatcher - INFO - Dispatcher started 2016-03-06 12:02:11,706 - telegram.updater - INFO - Updater thread started 2016-03-06 12:02:26,123 - telegram.bot - INFO - Getting updates: [645839879] 2016-03-06 12:02:26,173 - __main__ - DEBUG - Method: get_cards From: {'username': u'username', 'first_name': u'Firstname', 'last_name': u'Lastname', 'id': 12345678} chat_id: 12345678 Text: \/getcards<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442. \u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u043e\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0435\u0439 <code>Ctrl+C<\/code>, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f (<code>SIGINT<\/code>).<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445 \u043d\u0430\u0441 \u043a\u0430\u0440\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0438\u0445 \u0431\u0430\u043b\u0430\u043d\u0441\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>\/getcards<\/code>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0fc\/fff\/492\/0fcfff492a85437f8f70f649f621a375.png\" alt=\"\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0431\u043e\u0442\u043e\u043c\"\/><\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>users<\/code> \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0435\u0440\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0431\u043e\u0442\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/2\/library\/shelve.html\"><code>shelve<\/code><\/a>. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0418\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>python-telegram-bot<\/code><\/h2>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/python-telegram-bot\/python-telegram-bot\/\"><code>python-telegram-bot<\/code><\/a>. \u0422\u0430\u043c \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c <a href=\"https:\/\/github.com\/python-telegram-bot\/python-telegram-bot\/#jobqueue\">JobQueue<\/a>. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438? \u0412\u0438\u0434\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f:<\/p>\n<ol>\n<li>\u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 (\u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c) \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0431\u0430\u043b\u0430\u043d\u0441\u0435 \u043d\u0430 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u0440\u0442\u0430\u0445.<\/li>\n<li>\u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 (\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432 \u0447\u0430\u0441) \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u043d\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430\u0445 \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u043e \u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <code>CardInfo<\/code> \u043f\u043e\u043b\u0435, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0435 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0431\u0430\u043b\u0430\u043d\u0441 \u0438 \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. \u0418 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f: \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c <code>update()<\/code>.<\/li>\n<li>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u0443\u044e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0438\u043b\u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0435\u0433\u043e \u0442\u0440\u0435\u0432\u043e\u0436\u0438\u0442\u044c.<\/li>\n<\/ol>\n<p>  \u0422\u0443\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043b\u0435, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0435 \u044d\u0442\u0443 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u0443\u044e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443: <code>threshold<\/code>. \u0414\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0431\u043e\u0442\u0430.<\/p>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u21163 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/spitty\/strelka_telegram_bot\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0431\u043e\u0442\u0430 \u043d\u0430 Github<\/a>.<\/p>\n<h1>\u0420\u0435\u0437\u044e\u043c\u0435<\/h1>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"http:\/\/docs.python-requests.org\/en\/master\/\"><code>requests<\/code><\/a>, API \u0434\u043b\u044f \u0431\u043e\u0442\u043e\u0432 \u0432 Telegram \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/python-telegram-bot\/python-telegram-bot\/\"><code>python-telegram-bot<\/code><\/a> \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u0430\u043b\u0430\u043d\u0441 \u043d\u0430 \u0438\u0445 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430\u0445 \u0443\u043f\u0430\u043b \u0434\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438\u0437\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043f\u043e\u043b\u0435\u043d\u0438\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u044b \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u0437\u0430 \u0440\u0430\u043c\u043a\u0430\u043c\u0438, \u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c &quot;\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0430&quot; \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0435\u0451 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c \u0441 \u041f\u041a.<\/p>\n<p>  \u041d\u0430 Github \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0431\u043e\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/docs.python.org\/2\/library\/shelve.html\"><code>shelve<\/code><\/a> \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/github.com\/python-telegram-bot\/python-telegram-bot\/#jobqueue\">JobQueue<\/a>: <a href=\"https:\/\/github.com\/spitty\/strelka_telegram_bot\">strelka_telegram_bot<\/a>.         <\/p>\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=\"https:\/\/habrahabr.ru\/post\/278847\/\"> https:\/\/habrahabr.ru\/post\/278847\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h1>\u041e \u0447\u0451\u043c \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f?<\/h1>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 (Firefox) \u0438 Python \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e Telegram-\u0431\u043e\u0442\u0430 \u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>  \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0442\u0435\u043c, \u043a\u0442\u043e \u043d\u0430\u0441\u043b\u044b\u0448\u0430\u043d \u043e Telegram&#8217;\u043d\u044b\u0445 \u0431\u043e\u0442\u0430\u0445, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a \u043a \u043d\u0438\u043c \u043f\u043e\u0434\u0441\u0442\u0443\u043f\u0438\u0442\u044c\u0441\u044f \u0438 \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043d\u0438\u0435 Python.<\/p>\n<p>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/imgs.xkcd.com\/comics\/twitter_bot.png\" alt=\"writing a twitter bot\" title=\"PYTHON FLAG ENABLE THREE LAWS\"\/><br \/>  (<em><a href=\"http:\/\/xkcd.com\/1646\/\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b<\/a><\/em>)<\/p>\n<h1>TL;DR<\/h1>\n<p>  \u0418\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435:<\/p>\n<p>  1. \u041a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435?<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u0432\u0435\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><em>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f web tool \u0432\u0430\u0448\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.<\/em><\/p><\/div>\n<\/div>\n<p>  2. \u041a\u0430\u043a \u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python?<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u0432\u0435\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><em>\u0423\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u0431\u0451\u0440\u0442\u043a\u043e\u0439 \u043d\u0430\u0434 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c <a href=\"https:\/\/docs.python.org\/2\/library\/urllib2.html\"><code>urllib2<\/code><\/a> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"http:\/\/docs.python-requests.org\/en\/master\/\"><code>requests<\/code><\/a>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435: <a href=\"https:\/\/habrahabr.ru\/post\/126262\/\">&quot;\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432&quot;<\/a>.<\/em><\/p><\/div>\n<\/div>\n<p>  3. \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u043d\u0430 Python?<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u0432\u0435\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><em>\u041f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <a href=\"https:\/\/github.com\/python-telegram-bot\/python-telegram-bot\/\"><code>python-telegram-bot<\/code><\/a>. \u041f\u043e\u043a\u0430 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0430\u0441\u044c.<\/em><\/p><\/div>\n<\/div>\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-275732","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275732","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=275732"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275732\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}