{"id":390613,"date":"2024-06-29T09:20:49","date_gmt":"2024-06-29T09:20:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=390613"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=390613","title":{"rendered":"<span>Telegraph API: \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043c\u0435\u0442\u043e\u043a<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0440\u0432\u0438\u0441\u0443 telegra.ph \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442, \u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e api \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435 \u043c\u043d\u043e\u0433\u043e, \u0442\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c, \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u044b \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u043a  \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044e. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0435\u0431\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<h2>\u0421 \u0447\u0435\u0433\u043e \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c:<\/h2>\n<p>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c&#187;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c-\u043a\u0430\u043d\u0430\u043b\u0430\u0445 (&#171;\u0420\u0430\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0445, \u043d\u0443 \u043f\u043e\u0447\u0442\u0438&#187;, \u0438 &#171;RT \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c&#187;)<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/401\/795\/8a2\/4017958a2df6a032dd56d790526181ac.png\" width=\"452\" height=\"726\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/401\/795\/8a2\/4017958a2df6a032dd56d790526181ac.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443, \u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u0443\u0434\u044f-\u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043d\u0430 telegra.ph, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0432 \u0441\u0430\u043c\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0430\u0439\u0442, \u0438 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u043e\u043d\u0430 \u0442\u0443\u0434\u0430 \u0438 \u0432\u0435\u0434\u0435\u0442, \u0430 \u0432\u043e\u0442 \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440. \u041f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0441 \u0434\u0435\u0442\u0430\u043b\u044f\u043c\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043f\u043e\u0441\u0442\u0438\u043d\u0433 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u0444 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u043e\u0431 \u044d\u0442\u043e\u043c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440.<\/p>\n<h2>Array of Node \u0438\u043b\u0438 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430 Telegraph API \u0438 \u0435\u0451 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0432 Telegraph API \u043d\u0435\u0442, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0443\u0436\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 <em>Array of <\/em><a href=\"https:\/\/telegra.ph\/api#Node\" rel=\"noopener noreferrer nofollow\"><em>Node<\/em><\/a><em>, up to 64 KB<\/em>. \u0422.\u0435. \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c &#171;Hello world&#187; \u043d\u0435  \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f (\u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c [&#171;Hello world&#187;]), \u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443, \u0442\u0430\u043a \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440  &#171;<strong>Hello world&#187;<\/strong>:<\/p>\n<pre><code class=\"python\">[   {   \"tag\": \"b\",   \"children\": [\"Hello world\"]   } ]<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0435\u0441\u0442\u044c, \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/python-telegraph.readthedocs.io\/en\/latest\/index.html#\" rel=\"noopener noreferrer nofollow\">Telegraph<\/a>, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 \u043d\u0435\u0451. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430<\/h2>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a <a href=\"https:\/\/api.telegra.ph\/%method%\" rel=\"noopener noreferrer nofollow\">https:\/\/api.telegra.ph\/<\/a> \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u0438, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e, \u043f\u0443\u0442\u044c. \u0414\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u0443\u0433\u043e\u0434\u043d\u043e: curl \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0438\u043b\u0438 requests.get() \u0432 \u043f\u0438\u0442\u043e\u043d\u0435, \u0438\u043b\u0438 \u0433\u0434\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0435\u0449\u0451. \u042f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 python.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043a <a href=\"https:\/\/api.telegra.ph\/%method%\" rel=\"noopener noreferrer nofollow\">https:\/\/api.telegra.ph\/<\/a> \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 <strong>createAccount<\/strong>:<\/p>\n<pre><code class=\"python\">import requests #\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u044f data={     'short_name':'', # \u041e\u0411\u042f\u0417\u0410\u0422\u0415\u041b\u042c\u041d\u042b\u0419 \u041f\u0410\u0420\u0410\u041c\u0415\u0422\u0420, \u0438\u043c\u044f \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0430\u0434 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u00ab\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \/ \u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c\u00bb \u043d\u0430 Telegra.ph, \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u0432\u0438\u0434\u044f\u0442 \u044d\u0442\u043e \u0438\u043c\u044f.     'author_name':'', # \u041d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0430 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0441\u0442\u0440\u0430\u043d\u0446\u044b     'author_url':'' # \u041d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u0441\u044b\u043b\u043a\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u044e\u0442 \u043d\u0430 \u0438\u043c\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u043f\u043e\u0434 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0438\u043b\u0438 \u043a\u0430\u043d\u0430\u043b Telegram. } #\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f, \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e: result=requests.get(\"https:\/\/api.telegra.ph\/createAccount?\", params=data)<\/code><\/pre>\n<p>\u0418\u0437 bash \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">curl https:\/\/api.telegra.ph\/createAccount?short_name=Sandbox&amp;author_name=Anonymous<\/code><\/pre>\n<p>\u0421 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 telegraph: \u043d\u0443\u0436\u043d\u043e \u0435\u0451 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c (pip install telegraph), \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"python\">import requests from telegraph import Telegraph  telegraph = Telegraph()  result=telegraph.create_account(short_name='1337')<\/code><\/pre>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 json \u0441 \u0442\u043e\u043a\u0435\u043d\u043e\u043c \u0438 \u043f\u0440\u043e\u0447\u0438\u043c. \u0422\u043e\u043a\u0435\u043d \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c, \u044f \u0441\u043e\u0445\u0440\u0430\u043d\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b graph_bot.json <\/p>\n<pre><code class=\"python\">with open('graph_bot.json', 'w', encoding='utf-8') as f:     json.dump(graph_bot, f, ensure_ascii=False, indent=4) # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e \u0432 \u0444\u0430\u0439\u043b graph_bot<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 result.json()<\/p>\n<pre><code class=\"python\">{     \"ok\":true,     \"result\":     {         \"short_name\":\"\", #\u0442\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u044f         \"author_name\":\"\",         \"author_url\":\"\",         \"access_token\":\"\", #\u0442\u0443\u0442 \u0442\u043e\u043a\u0435\u043d         \"auth_url\":\"\"     } }<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043c\u0435\u0442\u043e\u0434\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0430 \u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b. \u0418\u043c\u0435\u043d\u0430 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u0432 \u043d\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043a\u0435\u043d\u0430\u0445. <\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (createPage)<\/h2>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u043a\u0435\u043d \u0438\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0433\u043e json \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b:<\/p>\n<pre><code class=\"python\">with open('graph_bot.json') as f:     graph_bot = json.load(f) #\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b data={     'access_token':graph_bot[\"access_token\"],     'title':'article_head', # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440     'author_name':graph_bot[\"author_name\"], # \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c     'content': content_json,# \u0422\u0435\u043a\u0441\u0442 (\u043c\u0430\u0441\u0441\u0438\u0432 Node), \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440     'return_content':'false' # \u0435\u0441\u043b\u0438 \u0441\u0442\u043e\u0438\u0442 true \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043f\u0440\u0438\u0434\u0435\u0442 \u0438 \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043e, \u0435\u0441\u043b\u0438 false, \u0442\u043e \u043f\u043e\u043b\u0435 \u043d\u0435 \u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f } page=requests.get(\"https:\/\/api.telegra.ph\/createPage?\", params=data)<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e, \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"python\">{     'ok': True,      'result':      {         'path': 'article-head-11-04-2',          'url': 'https:\/\/telegra.ph\/article-head-11-04-2',          'title': 'article_head',          'description': '',          'author_name': 'Bot',          'views': 0,          'can_edit': True     } }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u0439:<\/p>\n<pre><code class=\"python\">{     'ok': False,      'error': 'CONTENT_FORMAT_INVALID' # \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0435 array of node }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b \u0432\u044b\u0448\u0435, \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0443\u0442, \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0430\u0440\u0441\u0435\u0440 <strong>html to node<\/strong> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 <a href=\"https:\/\/python-telegraph.readthedocs.io\/en\/latest\/index.html#\" rel=\"noopener noreferrer nofollow\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 telegraph<\/a>. \u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0435\u0441\u044c HTML \u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0435\u0451 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f:<\/p>\n<pre><code class=\"python\">from telegraph import Telegraph  telegraph = Telegraph(\"access_token\") # \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 response = telegraph.create_page(     'Hey', # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b     html_content='&lt;p>Hello, world!&lt;\/p>' # \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 html_content, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b )  print('https:\/\/telegra.ph\/{}'.format(response['path'])) # \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443: <a href=\"https:\/\/telegra.ph\/Hey-11-04-22\" rel=\"noopener noreferrer nofollow\">https:\/\/telegra.ph\/Hey-11-04-22<\/a> <\/p>\n<p>\u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043d\u044b\u0445 \u0442\u044d\u0433\u043e\u0432, \u043d\u043e \u0434\u043b\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0442\u043a\u0438 telegra.ph \u0445\u0432\u0430\u0442\u0430\u0435\u0442<\/p>\n<h2>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (editPage)<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0430\u0434\u043e \u0437\u043d\u0430\u0442\u044c \u0435\u0451 \u0430\u0434\u0440\u0435\u0441, \u043e\u043d \u0438\u0434\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 ph\/ \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b <a href=\"https:\/\/telegra.ph\/Hey-11-04-22\" rel=\"noopener noreferrer nofollow\">https:\/\/telegra.ph\/<strong>Hey-11-04-22<\/strong><\/a> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 path \u0431\u0443\u0434\u0435\u0442 &#171;Hey-11-04-22&#187;. \u0418 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043a https:\/\/api.telegra.ph\/<strong>editPage<\/strong><\/p>\n<pre><code class=\"python\">data={     'path':'Hey-11-04-22', #\u043f\u0443\u0442\u044c \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 url \u043f\u043e\u0441\u043b\u0435 https:\/\/telegra.ph\/     'access_token':'your_token',  # \u0442\u043e\u043a\u0435\u043d     'title':'article_head', #\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c     'author_name':None,       'content': content_json,  #\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c  Array of Node     'return_content':'false'  } #\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b requests.get(\"https:\/\/api.telegra.ph\/editPage?\", params=data)<\/code><\/pre>\n<p> \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u0442\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c Array of Node. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"python\">from telegraph import Telegraph  telegraph = Telegraph('access_token') # \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0430\u0448\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c  telegraph.edit_page(     path=\"\", # \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440     title=\"\", # \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440     html_content=\"\",  #\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0445\u043e\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0442\u0435\u0433\u0430\u043c\u0438, \u0445\u043e\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e \u043d\u0430\u0434\u043e     author_name=\"\", # \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c     author_url=\"\", # \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c     return_content=False     )<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 {&#8216;ok&#8217;: False, &#8216;error&#8217;: &#8216;\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438&#8217;}. \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e, \u0441\u0442\u0430\u0442\u0443\u0441 &#8216;ok&#8217; \u0431\u0443\u0434\u0435\u0442 True.<\/p>\n<h2>\u0427\u0442\u043e \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e:<\/h2>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0434\u0443\u043c\u0430\u044e \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043d\u044f\u0442\u0435\u043d. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e: <\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435, <\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u043e\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d, <\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 <\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u043e\u0432 \u043d\u0430 \u043d\u0438\u0445 (\u0434\u0435\u043b\u0430\u0435\u043c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443). <\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0435:<\/p>\n<pre><code class=\"python\">data={     'access_token': \"access_token\",     'fields':'[\"short_name\",\"page_count\"]'     } account_info=requests.get(\"https:\/\/api.telegra.ph\/getAccountInfo?\", params=data) print(account_info.json())<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/b83\/c15\/fba\/b83c15fbabcdf0401a230344d8d13bfc.jpg\" width=\"626\" height=\"417\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b83\/c15\/fba\/b83c15fbabcdf0401a230344d8d13bfc.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/telegra.ph\/api\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e Telegraph API<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/python-telegraph.readthedocs.io\/en\/latest\/index.html\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e Telegraph Python Telegraph API wrapper<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/587430\/\"> https:\/\/habr.com\/ru\/articles\/587430\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0440\u0432\u0438\u0441\u0443 telegra.ph \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442, \u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e api \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435 \u043c\u043d\u043e\u0433\u043e, \u0442\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c, \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u044b \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u043a  \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044e. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0435\u0431\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<h2>\u0421 \u0447\u0435\u0433\u043e \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c:<\/h2>\n<p>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c&#187;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c-\u043a\u0430\u043d\u0430\u043b\u0430\u0445 (&#171;\u0420\u0430\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0445, \u043d\u0443 \u043f\u043e\u0447\u0442\u0438&#187;, \u0438 &#171;RT \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c&#187;)<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443, \u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u0443\u0434\u044f-\u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043d\u0430 telegra.ph, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0432 \u0441\u0430\u043c\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0430\u0439\u0442, \u0438 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u043e\u043d\u0430 \u0442\u0443\u0434\u0430 \u0438 \u0432\u0435\u0434\u0435\u0442, \u0430 \u0432\u043e\u0442 \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440. \u041f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0441 \u0434\u0435\u0442\u0430\u043b\u044f\u043c\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043f\u043e\u0441\u0442\u0438\u043d\u0433 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u0444 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u043e\u0431 \u044d\u0442\u043e\u043c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440.<\/p>\n<h2>Array of Node \u0438\u043b\u0438 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430 Telegraph API \u0438 \u0435\u0451 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0432 Telegraph API \u043d\u0435\u0442, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0443\u0436\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 <em>Array of <\/em><a href=\"https:\/\/telegra.ph\/api#Node\" rel=\"noopener noreferrer nofollow\"><em>Node<\/em><\/a><em>, up to 64 KB<\/em>. \u0422.\u0435. \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c &#171;Hello world&#187; \u043d\u0435  \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f (\u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c [&#171;Hello world&#187;]), \u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443, \u0442\u0430\u043a \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440  &#171;<strong>Hello world&#187;<\/strong>:<\/p>\n<pre><code class=\"python\">[   {   \"tag\": \"b\",   \"children\": [\"Hello world\"]   } ]<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0435\u0441\u0442\u044c, \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/python-telegraph.readthedocs.io\/en\/latest\/index.html#\" rel=\"noopener noreferrer nofollow\">Telegraph<\/a>, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 \u043d\u0435\u0451. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430<\/h2>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a <a href=\"https:\/\/api.telegra.ph\/%method%\" rel=\"noopener noreferrer nofollow\">https:\/\/api.telegra.ph\/<\/a> \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u0438, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e, \u043f\u0443\u0442\u044c. \u0414\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u0443\u0433\u043e\u0434\u043d\u043e: curl \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0438\u043b\u0438 requests.get() \u0432 \u043f\u0438\u0442\u043e\u043d\u0435, \u0438\u043b\u0438 \u0433\u0434\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0435\u0449\u0451. \u042f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 python.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043a <a href=\"https:\/\/api.telegra.ph\/%method%\" rel=\"noopener noreferrer nofollow\">https:\/\/api.telegra.ph\/<\/a> \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 <strong>createAccount<\/strong>:<\/p>\n<pre><code class=\"python\">import requests #\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u044f data={     'short_name':'', # \u041e\u0411\u042f\u0417\u0410\u0422\u0415\u041b\u042c\u041d\u042b\u0419 \u041f\u0410\u0420\u0410\u041c\u0415\u0422\u0420, \u0438\u043c\u044f \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0430\u0434 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u00ab\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \/ \u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c\u00bb \u043d\u0430 Telegra.ph, \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u0432\u0438\u0434\u044f\u0442 \u044d\u0442\u043e \u0438\u043c\u044f.     'author_name':'', # \u041d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0430 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0441\u0442\u0440\u0430\u043d\u0446\u044b     'author_url':'' # \u041d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u0441\u044b\u043b\u043a\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u044e\u0442 \u043d\u0430 \u0438\u043c\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u043f\u043e\u0434 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0438\u043b\u0438 \u043a\u0430\u043d\u0430\u043b Telegram. } #\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f, \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e: result=requests.get(\"https:\/\/api.telegra.ph\/createAccount?\", params=data)<\/code><\/pre>\n<p>\u0418\u0437 bash \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">curl https:\/\/api.telegra.ph\/createAccount?short_name=Sandbox&amp;author_name=Anonymous<\/code><\/pre>\n<p>\u0421 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 telegraph: \u043d\u0443\u0436\u043d\u043e \u0435\u0451 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c (pip install telegraph), \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"python\">import requests from telegraph import Telegraph  telegraph = Telegraph()  result=telegraph.create_account(short_name='1337')<\/code><\/pre>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 json \u0441 \u0442\u043e\u043a\u0435\u043d\u043e\u043c \u0438 \u043f\u0440\u043e\u0447\u0438\u043c. \u0422\u043e\u043a\u0435\u043d \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c, \u044f \u0441\u043e\u0445\u0440\u0430\u043d\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b graph_bot.json <\/p>\n<pre><code class=\"python\">with open('graph_bot.json', 'w', encoding='utf-8') as f:     json.dump(graph_bot, f, ensure_ascii=False, indent=4) # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e \u0432 \u0444\u0430\u0439\u043b graph_bot<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 result.json()<\/p>\n<pre><code class=\"python\">{     \"ok\":true,     \"result\":     {         \"short_name\":\"\", #\u0442\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u044f         \"author_name\":\"\",         \"author_url\":\"\",         \"access_token\":\"\", #\u0442\u0443\u0442 \u0442\u043e\u043a\u0435\u043d         \"auth_url\":\"\"     } }<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043c\u0435\u0442\u043e\u0434\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0430 \u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b. \u0418\u043c\u0435\u043d\u0430 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u0432 \u043d\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043a\u0435\u043d\u0430\u0445. <\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (createPage)<\/h2>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u043a\u0435\u043d \u0438\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0433\u043e json \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b:<\/p>\n<pre><code class=\"python\">with open('graph_bot.json') as f:     graph_bot = json.load(f) #\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b data={     'access_token':graph_bot[\"access_token\"],     'title':'article_head', # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440     'author_name':graph_bot[\"author_name\"], # \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c     'content': content_json,# \u0422\u0435\u043a\u0441\u0442 (\u043c\u0430\u0441\u0441\u0438\u0432 Node), \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440     'return_content':'false' # \u0435\u0441\u043b\u0438 \u0441\u0442\u043e\u0438\u0442 true \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043f\u0440\u0438\u0434\u0435\u0442 \u0438 \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043e, \u0435\u0441\u043b\u0438 false, \u0442\u043e \u043f\u043e\u043b\u0435 \u043d\u0435 \u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f } page=requests.get(\"https:\/\/api.telegra.ph\/createPage?\", params=data)<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e, \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"python\">{     'ok': True,      'result':      {         'path': 'article-head-11-04-2',          'url': 'https:\/\/telegra.ph\/article-head-11-04-2',          'title': 'article_head',          'description': '',          'author_name': 'Bot',          'views': 0,          'can_edit': True     } }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u0439:<\/p>\n<pre><code class=\"python\">{     'ok': False,      'error': 'CONTENT_FORMAT_INVALID' # \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0435 array of node }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b \u0432\u044b\u0448\u0435, \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0443\u0442, \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0430\u0440\u0441\u0435\u0440 <strong>html to node<\/strong> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 <a href=\"https:\/\/python-telegraph.readthedocs.io\/en\/latest\/index.html#\" rel=\"noopener noreferrer nofollow\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 telegraph<\/a>. \u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0435\u0441\u044c HTML \u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0435\u0451 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f:<\/p>\n<pre><code class=\"python\">from telegraph import Telegraph  telegraph = Telegraph(\"access_token\") # \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 response = telegraph.create_page(     'Hey', # \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b     html_content='&lt;p>Hello, world!&lt;\/p>' # \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 html_content, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b )  print('https:\/\/telegra.ph\/{}'.format(response['path'])) # \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443: <a href=\"https:\/\/telegra.ph\/Hey-11-04-22\" rel=\"noopener noreferrer nofollow\">https:\/\/telegra.ph\/Hey-11-04-22<\/a> <\/p>\n<p>\u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043d\u044b\u0445 \u0442\u044d\u0433\u043e\u0432, \u043d\u043e \u0434\u043b\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0442\u043a\u0438 telegra.ph \u0445\u0432\u0430\u0442\u0430\u0435\u0442<\/p>\n<h2>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (editPage)<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0430\u0434\u043e \u0437\u043d\u0430\u0442\u044c \u0435\u0451 \u0430\u0434\u0440\u0435\u0441, \u043e\u043d \u0438\u0434\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 ph\/ \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b <a href=\"https:\/\/telegra.ph\/Hey-11-04-22\" rel=\"noopener noreferrer nofollow\">https:\/\/telegra.ph\/<strong>Hey-11-04-22<\/strong><\/a> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 path \u0431\u0443\u0434\u0435\u0442 &#171;Hey-11-04-22&#187;. \u0418 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043a https:\/\/api.telegra.ph\/<strong>editPage<\/strong><\/p>\n<pre><code class=\"python\">data={     'path':'Hey-11-04-22', #\u043f\u0443\u0442\u044c \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 url \u043f\u043e\u0441\u043b\u0435 https:\/\/telegra.ph\/     'access_token':'your_token',  # \u0442\u043e\u043a\u0435\u043d     'title':'article_head', #\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c     'author_name':None,       'content': content_json,  #\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c  Array of Node     'return_content':'false'  } #\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b requests.get(\"https:\/\/api.telegra.ph\/editPage?\", params=data)<\/code><\/pre>\n<p> \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u0442\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c Array of Node. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"python\">from telegraph import Telegraph  telegraph = Telegraph('access_token') # \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0430\u0448\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c  telegraph.edit_page(     path=\"\", # \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440     title=\"\", # \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440     html_content=\"\",  #\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0445\u043e\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0442\u0435\u0433\u0430\u043c\u0438, \u0445\u043e\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e \u043d\u0430\u0434\u043e     author_name=\"\", # \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c     author_url=\"\", # \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c     return_content=False     )<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 {&#8216;ok&#8217;: False, &#8216;error&#8217;: &#8216;\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438&#8217;}. \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e, \u0441\u0442\u0430\u0442\u0443\u0441 &#8216;ok&#8217; \u0431\u0443\u0434\u0435\u0442 True.<\/p>\n<h2>\u0427\u0442\u043e \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e:<\/h2>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0434\u0443\u043c\u0430\u044e \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043d\u044f\u0442\u0435\u043d. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e: <\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435, <\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u043e\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d, <\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 <\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u043e\u0432 \u043d\u0430 \u043d\u0438\u0445 (\u0434\u0435\u043b\u0430\u0435\u043c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443). <\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0435:<\/p>\n<pre><code class=\"python\">data={     'access_token': \"access_token\",     'fields':'[\"short_name\",\"page_count\"]'     } account_info=requests.get(\"https:\/\/api.telegra.ph\/getAccountInfo?\", params=data) print(account_info.json())<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/telegra.ph\/api\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e Telegraph API<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/python-telegraph.readthedocs.io\/en\/latest\/index.html\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e Telegraph Python Telegraph API wrapper<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/587430\/\"> https:\/\/habr.com\/ru\/articles\/587430\/<\/a><br \/><\/br><\/br><\/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-390613","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/390613","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=390613"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/390613\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=390613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=390613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=390613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}