{"id":300864,"date":"2020-03-27T21:00:13","date_gmt":"2020-03-27T21:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=300864"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=300864","title":{"rendered":"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0431\u043e\u0440\u0430 \u043a\u0443\u043f\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/494460\/\">\n<h1 id=\"predystoriya\">\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u041d\u0430 \u041b\u0438\u0442\u0420\u0435\u0441 \u0435\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u043e\u043d\u0443\u0441\u043e\u0432 \u0438 \u043a\u0443\u043f\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0437\u0430\u0432\u0438\u0434\u043d\u043e\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u0436\u0435\u043d\u0435, \u0434\u0430 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0441\u0435\u0431\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u043a\u043d\u0438\u0436\u043a\u0443, \u043d\u0430\u0447\u0430\u043b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0441\u0430\u0439\u0442 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0432\u0435\u0436\u0438\u0435 \u043a\u0443\u043f\u043e\u043d\u044b \u0438 \u0441\u043a\u0438\u0434\u044b\u0432\u0430\u043b \u0438\u0445 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c. \u041d\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043c\u043d\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u043d\u0430\u0434\u043e\u0435\u043b\u043e \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u0441\u0435\u043c \u043a\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0445\u043e\u0447\u0435\u0442.<\/p>\n<p>  <\/p>\n<h1 id=\"realizaciya\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u043e\u0441\u0442\u0438\u043b \u043d\u043e\u0432\u044b\u0435 \u043a\u0443\u043f\u043e\u043d\u044b \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c, \u0434\u0430 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0430, \u0431\u043b\u0430\u0433\u043e \u0434\u0435\u043b\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 <strong>golang<\/strong> \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>telegram-bot-api<\/strong>. \u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0442\u044f\u043d\u0443\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0442\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u0439\u0442\u043e\u0432 \u0438 \u044f \u0434\u0443\u043c\u0430\u043b \u0432 \u0446\u0435\u043b\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0441\u0435\u0440, \u043d\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u043b\u0435\u043d\u044c, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c <a href=\"https:\/\/lovikod.ru\/knigi\/promokody-litres\" rel=\"nofollow\">\u0440\u0435\u0441\u0443\u0440\u0441\u0435<\/a>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0443\u043f\u043e\u043d\u044b \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430, \u0440\u0435\u0448\u0438\u043b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 sqlite3. \u0412 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u0443\u043f\u043e\u043d\u0430\u0445, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0435, \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c \u043a\u0430\u043a\u0438\u0435 \u043a\u0443\u043f\u043e\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u00a0\u0438 \u043a\u0430\u043a\u0438\u0435 \u0435\u0449\u0451 \u043d\u0435\u0442. <\/p>\n<p>  <\/p>\n<h4 id=\"vyglyadit-eto-primerno-tak\">\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a.<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mn\/1_\/zh\/mn1_zhyacxjzzk7jco9kzrhpnmo.png\"><a name=\"habracut\"><\/a>  <\/p>\n<h4 id=\"parsing-sayta\">\u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0441\u0430\u0439\u0442\u0430<\/h4>\n<p>  <\/p>\n<p>\u041f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u0441\u0430\u0439\u0442\u0430 \u0443 \u043d\u0430\u0441 \u0437\u0430\u0439\u043c\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <strong>goquery<\/strong> \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 jquery.<br \/>  \u041e\u043f\u0435\u0440\u0438\u0440\u0443\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 <strong>goquery.Document<\/strong> \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u043c html \u0442\u0435\u0433\u0438 \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u0442\u0443, \u043a\u043e\u0434, \u0441\u0441\u044b\u043b\u043a\u0443 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0443\u043f\u043e\u043d\u0430. \u041a\u0443\u043f\u043e\u043d\u044b \u0431\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u043d \u0434\u0430\u0435\u0442. \u0412\u0440\u0435\u043c\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 \u0437\u043d\u0430\u0447\u0438\u0442 \u0435\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c unixtime, \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u043a\u043e\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043a\u0443\u043f\u043e\u043d\u043e\u0432. \u0421\u0441\u044b\u043b\u043a\u0443 \u0442\u043e\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c, \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0430 \u043d\u0430\u0441 \u043d\u0430 \u0441\u0430\u0439\u0442 \u041b\u0438\u0442\u0420\u0435\u0441, \u0438\u043d\u0430\u0447\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430. \u0421\u0432\u044f\u0437\u0430\u043d\u0430 \u043e\u043d\u0430 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0430 \u0432\u0435\u0434\u0435\u0442 \u043d\u0430 \u0441\u0430\u0439\u0442 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u043c \u043a\u0443\u043f\u043e\u043d\u044b, \u0438 \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u0442\u0443\u0434\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u043f\u0440\u044f\u043c\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0430\u0439\u0442 \u0442\u043e js \u043d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u043c\u044b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. <\/p>\n<p>  <\/p>\n<h4 id=\"telegram-bot\">Telegram bot<\/h4>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>BotFather<\/strong> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 telegram \u0435\u0441\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f. \u0412 telegram api \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u0434\u0448\u0438\u0435 \u0441 \u0431\u043e\u0442\u043e\u043c, \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 http \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0434\u0430\u0441\u0442 \u0432\u0441\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u0443\u0442\u0443\u0440\u044b \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u043e websocket. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0430\u043a \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0431\u043b\u0430\u0433\u043e \u0434\u0435\u043b\u043e \u0447\u0442\u043e \u0432 <strong>telegram-bot-api<\/strong> \u0435\u0441\u0442\u044c updater \u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432\u044b \u043d\u0435 \u043f\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0435.<\/p>\n<p><cut><\/cut>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">type SNBot struct {     cfg *Config     bot *tgbotapi.BotAPI     upd tgbotapi.UpdatesChannel }  func New(cfg *Config) (*SNBot, error) {     bot, err := tgbotapi.NewBotAPI(cfg.Token)     if err != nil {         return nil, err     }     level.Info(cfg.Logger).Log(&quot;msg&quot;, &quot;Authorized on account&quot;, &quot;bot-name&quot;, bot.Self.UserName)     u := tgbotapi.NewUpdate(0)     u.Timeout = cfg.UpdateTime     updates, err := bot.GetUpdatesChan(u)     if err != nil {         return nil, err     }     return &amp;SNBot{         cfg: cfg,         bot: bot,         upd: updates,     }, nil }<\/code><\/pre>\n<\/div>\n<\/div>\n<p><cut><\/cut>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0430\u0437\u044b, \u0431\u043e\u0442\u0430 \u0438 \u043f\u0430\u0440\u0441\u0435\u0440\u0430 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0448 \u0431\u043e\u0442 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0443, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <strong>gocron<\/strong>. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0430\u0440\u0441\u0435\u0440 \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u0430\u0439\u0442 \u043f\u043e\u0442\u043e\u043c task \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0432 gocron \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u0447\u0430\u0442\u044b \u0438\u0437 storage \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u0443\u043f\u043e\u043d\u044b \u0438\u0437 <strong>storage<\/strong> \u0432 \u0447\u0430\u0442 \u044e\u0437\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Task function<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">func task(bot *snbot.SNBot, s *storage.Storage, c *collector.Collector, logger kitlog.Logger) {     c.Collect(collector.ConditionQuery{         URI: &quot;https:\/\/lovikod.ru\/knigi\/promokody-litres&quot;,     })     chats, err := s.GetChat()     if err != nil {         level.Error(logger).Log(&quot;msg&quot;, &quot;failed get chats&quot;, &quot;err&quot;, err)     }     for _, id := range chats {         records, err := s.GetNotUseCoupon(id)         if err != nil {             level.Error(logger).Log(&quot;msg&quot;, &quot;failed get coupons&quot;, &quot;err&quot;, err)             return         }         var msg string         for i, rec := range records {             msg = fmt.Sprintf(&quot;%v%v:\\t%s \\n\u041a\u043e\u0434---&gt;: %s\\n\u0412\u0440\u0435\u043c\u044f \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044f: %v\\n\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435: %s\\n\\n&quot;, msg, i+1, rec.Link, rec.Code, time.Unix(rec.Date, 0).Format(&quot;02.01.2006&quot;), rec.Description)         }         if len(msg) != 0 {             err = bot.Send(id, msg)             if err != nil {                 level.Error(logger).Log(&quot;msg&quot;, &quot;failed send message&quot;, &quot;err&quot;, err)                 continue             }             err = s.MarkAsRead(id, records)             if err != nil {                 level.Error(logger).Log(&quot;msg&quot;, &quot;failed marked as read&quot;, &quot;err&quot;, err)                 continue             }         }     }     level.Info(logger).Log(&quot;msg&quot;, &quot;send all chats new coupons&quot;) }<\/code><\/pre>\n<\/div>\n<\/div>\n<p><cut><\/cut>  <\/p>\n<blockquote><p>\u0418\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0443\u043f\u043e\u043d\u043e\u0432 \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0447\u0430\u0442, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0443\u043f\u043e\u043d\u043e\u0432 \u0437\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043e \u043f\u044f\u0442\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043f\u0435\u0446 \u043a\u043d\u043e\u043f\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0435\u0449\u0451 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u0443\u043f\u043e\u043d\u044b. <\/p><\/blockquote>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">func (s *SNBot) Send(chatID int64, msg string) error {     level.Error(s.cfg.Logger).Log(&quot;msg&quot;, &quot;try send&quot;, &quot;chatID&quot;, chatID)     var numericKeyboard = tgbotapi.NewReplyKeyboard(         tgbotapi.NewKeyboardButtonRow(             tgbotapi.NewKeyboardButton(&quot;\/print5&quot;),         ),     )     m := tgbotapi.NewMessage(chatID, msg)     m.ReplyMarkup = numericKeyboard     _, err := s.bot.Send(m)     if err != nil {         if err.Error() == errBlockedByUser {             s.cfg.Storage.UpdChatActivity(chatID, false)         }         return err     }     return nil }<\/code><\/pre>\n<\/div>\n<\/div>\n<p><cut><\/cut>  <\/p>\n<h4 id=\"sozdanie-dockerfile\">\u00a0\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Dockerfile<\/h4>\n<p>  <\/p>\n<p>\u041a\u0430\u043a\u043e\u0435 \u043d\u044b\u043d\u0447\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0430 \u0438 \u0431\u0435\u0437 \u0434\u043e\u043a\u0435\u0440\u0430, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u00a0\u0434\u043e\u043a\u0435\u0440 \u043e\u0431\u0440\u0430\u0437.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># build binary FROM golang:1.10.3-alpine3.8 AS build RUN apk add --no-cache linux-headers gcc g++ ARG VERSION=dev WORKDIR \/go\/src\/github.com\/wenkaler\/xfreehack COPY . \/go\/src\/github.com\/wenkaler\/xfreehack RUN CGO_ENABLED=1 go build \\     -o \/out\/xfree \\     -ldflags &quot;-X main.serviceVersion=$VERSION&quot; \\     github.com\/wenkaler\/xfreehack\/cmd  # copy to alpine image FROM alpine:3.8 WORKDIR \/app RUN mkdir \/db COPY --from=build \/out\/xfree \/app RUN apk add --no-cache tzdata RUN apk --no-cache add ca-certificates ENV TZ Europe\/Moscow RUN ln -snf \/usr\/share\/zoneinfo\/$TZ \/etc\/localtime &amp;&amp; echo $TZ &gt; \/etc\/timezone CMD [&quot;\/app\/xfree&quot;]<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"systemd\">Systemd<\/h4>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u0432\u0441\u0435 \u0436\u0435 \u043a\u0443\u043f\u0438\u043b \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0443. \u041d\u043e \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u043d\u0435\u0439 \u0441\u0442\u043e\u0438\u0442 \u044f\u0434\u0440\u043e \u0432\u0435\u0440\u0441\u0438\u0438 2.6, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u043f\u0430\u0440\u0438\u0442\u044c\u0441\u044f \u0441 \u0435\u0433\u043e upgrad-\u043e\u043c \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0447\u0435\u0440\u0435\u0437 systemd. \u0417\u0430\u0447\u0435\u043c? \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u043a\u0435\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u044f\u0434\u0440\u043e\u043c \u043d\u0438\u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 3.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[Unit] Description=Xfree service After=network.target After=network-online.target  [Service] ExecStart=\/urs\/local\/bin\/xfree Environment=&quot;TELEGRAM_TOKEN=$TELEGRAM_TOKEN&quot; &quot;PATH_DB=\/db\/xfree.db&quot; TimeoutSec=30 Restart=on-failure RestartSec=30  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p><cut><\/cut>  <\/p>\n<h2 id=\"vyvod\">\u0412\u044b\u0432\u043e\u0434<\/h2>\n<p>  <\/p>\n<p>\u00a0\u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u0430, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u043a\u043d\u0438\u0433\u0438 \u043d\u0430 \u041b\u0438\u0442\u0420\u0435\u0441, \u043d\u0443 \u0430 \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.\u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444-\u044f MarkAsRead (\u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u043b\u043e, \u043d\u043e \u043c\u0430\u043b\u043e \u043b\u0438), \u0442\u0430\u043a \u0436\u0435 \u043e\u043d \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043b\u044e\u0434\u044f\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u043d\u0435\u0433\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0445 \u0432 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \/start. \u041d\u0443 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u0443\u043f\u043e\u043d\u043e\u0432, \u0432\u0435\u0434\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0435\u0441\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0443\u043f\u043e\u043d\u044b \u043e\u0442 \u041b\u0438\u0442\u0420\u0435\u0441. \u041d\u043e \u044d\u0442\u043e \u0432\u0441\u0435 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u044f\u0432\u043e\u043a \u043d\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u043b\u043e. <\/p>\n<p>  <\/p>\n<h4 id=\"ssylki\">\u0421\u0441\u044b\u043b\u043a\u0438<\/h4>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/github.com\/wenkaler\/xfreehack\" rel=\"nofollow\">\u0421\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/a><\/li>\n<li><a href=\"https:\/\/https:\/\/lovikod.ru\/knigi\/promokody-litres\" rel=\"nofollow\">\u0421\u0430\u0439\u0442 \u0441 \u043a\u0443\u043f\u043e\u043d\u0430\u043c\u0438<\/a><\/li>\n<li>\u0418\u043c\u044f \u0431\u043e\u0442\u0430 @xFreeCouponBot<\/li>\n<\/ol>\n<\/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:\/\/habr.com\/ru\/post\/494460\/\"> https:\/\/habr.com\/ru\/post\/494460\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/494460\/\">\n<h1 id=\"predystoriya\">\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u041d\u0430 \u041b\u0438\u0442\u0420\u0435\u0441 \u0435\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u043e\u043d\u0443\u0441\u043e\u0432 \u0438 \u043a\u0443\u043f\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0437\u0430\u0432\u0438\u0434\u043d\u043e\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u0436\u0435\u043d\u0435, \u0434\u0430 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0441\u0435\u0431\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u043a\u043d\u0438\u0436\u043a\u0443, \u043d\u0430\u0447\u0430\u043b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0441\u0430\u0439\u0442 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0432\u0435\u0436\u0438\u0435 \u043a\u0443\u043f\u043e\u043d\u044b \u0438 \u0441\u043a\u0438\u0434\u044b\u0432\u0430\u043b \u0438\u0445 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c. \u041d\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043c\u043d\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u043d\u0430\u0434\u043e\u0435\u043b\u043e \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u0441\u0435\u043c \u043a\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0445\u043e\u0447\u0435\u0442.<\/p>\n<p>  <\/p>\n<h1 id=\"realizaciya\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u043e\u0441\u0442\u0438\u043b \u043d\u043e\u0432\u044b\u0435 \u043a\u0443\u043f\u043e\u043d\u044b \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c, \u0434\u0430 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0430, \u0431\u043b\u0430\u0433\u043e \u0434\u0435\u043b\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 <strong>golang<\/strong> \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>telegram-bot-api<\/strong>. \u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0442\u044f\u043d\u0443\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0442\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u0439\u0442\u043e\u0432 \u0438 \u044f \u0434\u0443\u043c\u0430\u043b \u0432 \u0446\u0435\u043b\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0441\u0435\u0440, \u043d\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u043b\u0435\u043d\u044c, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c <a href=\"https:\/\/lovikod.ru\/knigi\/promokody-litres\" rel=\"nofollow\">\u0440\u0435\u0441\u0443\u0440\u0441\u0435<\/a>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0443\u043f\u043e\u043d\u044b \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430, \u0440\u0435\u0448\u0438\u043b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 sqlite3. \u0412 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u0443\u043f\u043e\u043d\u0430\u0445, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0435, \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c \u043a\u0430\u043a\u0438\u0435 \u043a\u0443\u043f\u043e\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u00a0\u0438 \u043a\u0430\u043a\u0438\u0435 \u0435\u0449\u0451 \u043d\u0435\u0442. <\/p>\n<p>  <\/p>\n<h4 id=\"vyglyadit-eto-primerno-tak\">\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a.<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mn\/1_\/zh\/mn1_zhyacxjzzk7jco9kzrhpnmo.png\"><\/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-300864","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300864","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=300864"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300864\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=300864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=300864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=300864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}