{"id":380075,"date":"2024-06-27T09:04:40","date_gmt":"2024-06-27T09:04:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=380075"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=380075","title":{"rendered":"<span>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c Python-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442 \u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0438 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430<\/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>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043a\u043e\u0441\u043c\u043e\u0441 \u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0447\u0435\u0440\u0435\u0437 API \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e SMS \u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u044e\u0449\u0435\u043c\u0441\u044f \u043a \u0417\u0435\u043c\u043b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n<h3>NASA OpenAPI<\/h3>\n<p>NASA \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 15 \u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445! \u0412\u0441\u044f \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0448\u0438\u0440\u043e\u043a\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e API \u0430\u0433\u0435\u043d\u0442\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 API, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u043a\u0430\u043c\u0435\u0440\u0430 \u043f\u043e\u043b\u0438\u0445\u0440\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0417\u0435\u043c\u043b\u0438 (EPIC) \u2014 \u043f\u043e\u043b\u043d\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0438\u0441\u043a\u0430 \u0417\u0435\u043c\u043b\u0438:<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0440\u043e\u0434\u043d\u044b\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u043e\u0431\u0441\u0435\u0440\u0432\u0430\u0442\u043e\u0440\u0438\u0435\u0439 EONET \u2014 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u044b, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0440\u043e\u0434\u043d\u044b\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0448\u0442\u043e\u0440\u043c\u043e\u0432, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u0417\u0435\u043c\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0432\u0438\u0434\u0435\u043e NASA \u2014 \u0434\u043e\u0441\u0442\u0443\u043f \u043a <a href=\"https:\/\/images.nasa.gov\/#\/\"><u>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0432\u0438\u0434\u0435\u043e<\/u><\/a>;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0432\u0443\u043a\u0438 (\u0431\u0435\u0442\u0430-\u0432\u0435\u0440\u0441\u0438\u044f) \u2014 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0437\u0432\u0443\u043a\u0430\u043c \u0447\u0435\u0440\u0435\u0437 SoundCloud \u0441 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0448\u0443\u043c\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u0431\u043b\u0438\u0436\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 \u0417\u0435\u043c\u043b\u0451\u0439 (NeoWs) \u2014 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0440\u0436\u0430\u0442 \u043a\u0443\u0440\u0441 \u043d\u0430 \u043d\u0430\u0448\u0443 \u043f\u043b\u0430\u043d\u0435\u0442\u0443. \u042d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u043c \u0438 \u043d\u0443\u0436\u0435\u043d.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c NASA API<\/h3>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u043a\u0443 \u043c\u044b \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0432 <a href=\"https:\/\/hackernoon.com\/build-a-pyton-app-to-alert-you-for-asteroids-close-to-earth\"><u>\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 HackerNoon<\/u><\/a>. \u0418 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0433\u0438 \u0434\u043b\u044f \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438 \u0425\u0430\u0431\u0440\u0430.<\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443. \u041d\u0430 <a href=\"https:\/\/api.nasa.gov\/index.html\"><u>\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 NASA<\/u><\/a> \u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u0430\u0447\u0438 \u0437\u0430\u044f\u0432\u043a\u0438 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043b\u0438\u0447\u043d\u043e\u0433\u043e API-\u043a\u043b\u044e\u0447\u0430. \u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u044f\u0432\u043a\u0438 NASA \u043f\u0440\u0438\u0448\u043b\u0451\u0442 \u0432\u0430\u043c \u043a\u043b\u044e\u0447 \u043f\u043e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a46\/aee\/8f5\/a46aee8f5a4e576ff11d117acbe21f25.jpeg\" alt=\"\u042d\u043a\u0440\u0430\u043d \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 API \u041d\u0410\u0421\u0410.\" width=\"1200\" height=\"648\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a46\/aee\/8f5\/a46aee8f5a4e576ff11d117acbe21f25.jpeg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u042d\u043a\u0440\u0430\u043d \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 API \u041d\u0410\u0421\u0410.<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 API \u0432 1\u00a0000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0447\u0430\u0441. \u041e\u043d\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u043d\u0435 \u0434\u043b\u044f \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u0446\u0435\u043b\u0435\u0439.<\/p>\n<h3>\u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 NASA API<\/h3>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 API, \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 (GET):<\/p>\n<ul>\n<li>\n<p>start_date (\u0413\u0413\u0413\u0413-\u041c\u041c-\u0414\u0414) \u2014 \u0434\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>end_date (\u0413\u0413\u0413\u0413-\u041c\u041c-\u0414\u0414) \u2014 \u0434\u0430\u0442\u0430 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>api_key \u2014 \u043a\u043b\u044e\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u043e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0442\u0432\u0435\u0442:<\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 JSON \u0441 \u0446\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<pre><code class=\"json\">{     \"links\": {         \"next\": \"http:\/\/api.nasa.gov\/neo\/rest\/v1\/feed?start_date=2023-10-17&amp;end_date=2023-10-17&amp;detailed=false&amp;api_key=8DaCUyeKqnNbupBJvDO42iUMS6tqfLFK4JjM263G\",         \"prev\": \"http:\/\/api.nasa.gov\/neo\/rest\/v1\/feed?start_date=2023-10-15&amp;end_date=2023-10-15&amp;detailed=false&amp;api_key=8DaCUyeKqnNbupBJvDO42iUMS6tqfLFK4JjM263G\",         \"self\": \"http:\/\/api.nasa.gov\/neo\/rest\/v1\/feed?start_date=2023-10-16&amp;end_date=2023-10-16&amp;detailed=false&amp;api_key=8DaCUyeKqnNbupBJvDO42iUMS6tqfLFK4JjM263G\"     },     \"element_count\": 10,     \"near_earth_objects\": {         \"2023-10-16\": [             {                 \"links\": {                     \"self\": \"http:\/\/api.nasa.gov\/neo\/rest\/v1\/neo\/2337558?api_key=8DaCUyeKqnNbupBJvDO42iUMS6tqfLFK4JjM263G\"                 },                 \"id\": \"2337558\",                 \"neo_reference_id\": \"2337558\",                 \"name\": \"337558 (2001 SG262)\",                 \"nasa_jpl_url\": \"http:\/\/ssd.jpl.nasa.gov\/sbdb.cgi?sstr=2337558\",                 \"absolute_magnitude_h\": 19.33,                 \"estimated_diameter\": {                     \"kilometers\": {                         \"estimated_diameter_min\": 0.3618719966,                         \"estimated_diameter_max\": 0.8091703835                     },                     \"meters\": {                         \"estimated_diameter_min\": 361.8719965994,                         \"estimated_diameter_max\": 809.1703835499                     },                     \"miles\": {                         \"estimated_diameter_min\": 0.2248567644,                         \"estimated_diameter_max\": 0.5027950104                     },                     \"feet\": {                         \"estimated_diameter_min\": 1187.2441213233,                         \"estimated_diameter_max\": 2654.758561166                     }                 },                 \"is_potentially_hazardous_asteroid\": true,                 \"close_approach_data\": [                     {                         \"close_approach_date\": \"2023-10-16\",                         \"close_approach_date_full\": \"2023-Oct-16 16:00\",                         \"epoch_date_close_approach\": 1697472000000,                         \"relative_velocity\": {                             \"kilometers_per_second\": \"20.8203253059\",                             \"kilometers_per_hour\": \"74953.171101087\",                             \"miles_per_hour\": \"46572.9856766726\"                         },                         \"miss_distance\": {                             \"astronomical\": \"0.2519750156\",                             \"lunar\": \"98.0182810684\",                             \"kilometers\": \"37694925.626976772\",                             \"miles\": \"23422540.6669605736\"                         },                         \"orbiting_body\": \"Earth\"                     }                 ],                 \"is_sentry_object\": false             },             [...]<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 near_earth_objects \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0434\u0435\u0442\u0430\u043b\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>estimated_diameter \u2014 \u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0432 \u043c\u0435\u0442\u0440\u0430\u0445, \u043a\u0438\u043b\u043e\u043c\u0435\u0442\u0440\u0430\u0445, \u043c\u0438\u043b\u044f\u0445 \u0438 \u0444\u0443\u0442\u0430\u0445<\/p>\n<\/li>\n<li>\n<p>relative_velocity \u2014 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>miss_distance \u2014 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u043e\u0440\u0431\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043b\u0430<\/p>\n<\/li>\n<li>\n<p>orbiting_body \u2014 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u044d\u0442\u043e \u0417\u0435\u043c\u043b\u044f, \u043d\u043e \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u043e\u0438\u0441\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>NASA API \u0434\u0430\u0451\u0442 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0440\u044f\u0434\u043e\u043c. \u041c\u044b \u043d\u0430\u0439\u0434\u0451\u043c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0438\u0437 \u043d\u0438\u0445, \u0447\u0442\u043e\u0431\u044b \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432 SMS. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e Python \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>requests<\/strong>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0451 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Python, \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0435\u0433\u043e \u0441 <a href=\"https:\/\/www.python.org\/downloads\/\"><u>\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430<\/u><\/a>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 requests, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:\u00a0<\/p>\n<pre><code class=\"python\">$ python -m pip install requests<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 alert.py. \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 requests, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 API. \u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 date \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f datetime, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044e\u044e \u0434\u0430\u0442\u0443:<\/p>\n<pre><code class=\"python\">import requests from datetime import date<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044e\u044e \u0434\u0430\u0442\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u043d\u0443\u0436\u043d\u043e\u043c \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 NASA:<\/p>\n<pre><code class=\"python\"># \u0421\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0434\u0430\u0442\u0430 todays_date = date.today().strftime(\"%Y-%m-%d\")<\/code><\/pre>\n<p>\u041f\u0440\u043e\u043f\u0438\u0448\u0438\u0442\u0435 API-\u043a\u043b\u044e\u0447 \u0438 URL-\u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a NASA API. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 API-\u043a\u043b\u044e\u0447 \u043d\u0443\u0436\u043d\u043e <a href=\"https:\/\/api.nasa.gov\/\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>:<\/p>\n<pre><code class=\"python\">nasa_api_key = \"NASA_API_KEY\" nasa_url = \"https:\/\/api.nasa.gov\/neo\/rest\/v1\/feed?start_date=\" + todays_date +\"&amp;end_date=\"+ todays_date + \"&amp;api_key=\"+nasa_api_key<\/code><\/pre>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 GET-\u0437\u0430\u043f\u0440\u043e\u0441 \u0432 NASA API \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0442\u0432\u0435\u0442 \u0432 JSON-\u0444\u043e\u0440\u043c\u0430\u0442:<\/p>\n<pre><code class=\"python\"># \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 NASA API \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u0432 JSON nasa_response = requests.get(nasa_url) json_nasa_response = nasa_response.json()<\/code><\/pre>\n<p>\u0412 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c \u043e\u0442 NASA \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u043a \u0417\u0435\u043c\u043b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 near_earth_objects. \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0432\u0441\u0435\u0445 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u043a \u0417\u0435\u043c\u043b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432:<\/p>\n<pre><code class=\"python\"># \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u043a \u0417\u0435\u043c\u043b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0432\u0441\u0435\u0445 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432 def find_closest_asteroid_index(near_asteroids):     # \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u044f \u0443\u0447\u0451\u0442\u0430 \u0434\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432 \u043e\u0442 \u0417\u0435\u043c\u043b\u0438     asteroids = []     # \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u044b \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 near_earth_objects     for i in range(0, len(near_asteroids)):         # \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u0417\u0435\u043c\u043b\u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432         asteroids.insert(i, near_asteroids[i]['close_approach_data'][0]['miss_distance']['kilometers'])     # \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441     # \u0438\u043d\u0434\u0435\u043a\u0441 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0432 near_earth_objects         return asteroids.index(min(asteroids))<\/code><\/pre>\n<h3>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0435<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 NASA API \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0431\u043b\u0438\u0437\u0438 \u0417\u0435\u043c\u043b\u0438 \u0435\u0441\u0442\u044c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u044b. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0435\u0441\u0442\u044c \u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 near_earth_objects \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043e\u0442 NASA API. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432 \u0438 \u043d\u0430\u0439\u0434\u0438\u0442\u0435 \u0438\u043d\u0434\u0435\u043a\u0441 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435:<\/p>\n<pre><code class=\"python\"># \u0415\u0441\u043b\u0438 \u043e\u043a\u043e\u043b\u043e \u0417\u0435\u043c\u043b\u0438 \u0435\u0441\u0442\u044c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u044b if \"near_earth_objects\" in json_nasa_response:     # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432     near_asteroids = json_nasa_response['near_earth_objects'][todays_date]     # \u0418\u043d\u0434\u0435\u043a\u0441 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430     closest_asteroid_index = find_closest_asteroid_index(near_asteroids)<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0432 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0438:<\/p>\n<pre><code class=\"python\">    # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0432 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0438     name = near_asteroids[closest_asteroid_index]['name'] #\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430     how_close = near_asteroids[closest_asteroid_index]['close_approach_data'][0]['miss_distance']['kilometers'] #\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0417\u0435\u043c\u043b\u0438     diameter =  near_asteroids[closest_asteroid_index]['estimated_diameter']['meters']['estimated_diameter_max'] #\u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0439\u0442\u0435 \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">    # \u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443     how_close_str = str(round(float(how_close)))     diameter_str = str(round(diameter))         # \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435     alert =\"\u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434 \u0441\u0435\u0433\u043e\u0434\u043d\u044f - \" + name + \". \u041e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \" + how_close_str + \" \u043a\u043c \u043e\u0442 \u0417\u0435\u043c\u043b\u0438. \u0415\u0433\u043e \u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \" + diameter_str + \" \u043c\u0435\u0442\u0440\u043e\u0432.\"<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/exolve.ru\/products\/sms-api\/?utm_source=habr&amp;utm_medium=refferal&amp;utm_campaign=sms_api_article&amp;utm_content=article_asteroid&amp;utm_term=sms_api_exolve\"><u>Exolve SMS API<\/u><\/a>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/exolve.ru\/products\/sms-api\/?utm_source=habr&amp;utm_medium=refferal&amp;utm_campaign=sms_api_article&amp;utm_content=article_asteroid&amp;utm_term=sms_api_exolve\"><u>\u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0432 MTC Exolve<\/u><\/a>;<\/p>\n<\/li>\n<li>\n<p>API-\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e API-\u043a\u043b\u044e\u0447, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/instructions\/creating-app\/\"><u>\u00ab\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u00bb<\/u><\/a> \u0438 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/instructions\/getting-api-key\/\"><u>\u00abAPI-\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u00bb<\/u><\/a>;<\/p>\n<\/li>\n<li>\n<p>\u043d\u043e\u043c\u0435\u0440 Exolve. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043a\u0443\u043f\u0438\u0442\u044c \u043d\u043e\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/instructions\/buying-number\/\"><u>\u00ab\u041f\u043e\u043a\u0443\u043f\u043a\u0430 \u043d\u043e\u043c\u0435\u0440\u0430\u00bb<\/u><\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043a\u043e\u0434 \u043d\u043e\u043c\u0435\u0440 Exolve, URL-\u0430\u0434\u0440\u0435\u0441, API-\u043a\u043b\u044e\u0447 \u0438 \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f:<\/p>\n<pre><code class=\"python\">    # \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Exolve     exolve_number = \"7999XXXXXXX\"     exolve_url = \"https:\/\/api.exolve.ru\/messaging\/v1\/SendSMS\"     recipient_number = \"7924XXXXXXX\"     exolve_api_key = \"EXOLVE_API_KEY\"<\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a Exolve API \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 requests, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0441\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u043d\u0435\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0435:<\/p>\n<pre><code class=\"python\">    # \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 EXOLVE SMS API \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u0432 JSON     exolve_response = requests.post(exolve_url,     headers = {\"Authorization\": \"Bearer \" + exolve_api_key},     json = {         \"number\": exolve_number,         \"destination\": recipient_number,         \"text\": alert     })     json_exolve_response = exolve_response.json()     print(json_exolve_response) # message_id \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u0434. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0435\u0435 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e88\/763\/62d\/e8876362d8747d8a5543f9a7fc49d4d6.png\" alt=\"SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435\" title=\"SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435\" width=\"1170\" height=\"1000\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e88\/763\/62d\/e8876362d8747d8a5543f9a7fc49d4d6.png\"\/><\/p>\n<div><figcaption>SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435<\/figcaption><\/div>\n<\/figure>\n<h3>\u0420\u0435\u0437\u044e\u043c\u0435<\/h3>\n<p>\u041f\u043e\u0434\u044b\u0442\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043a\u043b\u044e\u0447 API \u0434\u043b\u044f \u043f\u043e\u0440\u0442\u0430\u043b\u0430 NASA OpenAPI.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u0443\u0447\u0438\u043b\u0438 API NeoWs, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0451\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430\u0445, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043a \u0417\u0435\u043c\u043b\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0448\u043b\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u043a \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u043d\u0435\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0437 \u0432\u0441\u0435\u0445 \u0442\u0435\u0445, \u0447\u0442\u043e \u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u043e\u0431\u043b\u0438\u0437\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u043e\u0431 \u044d\u0442\u043e\u0439 \u0432\u0441\u0442\u0440\u0435\u0447\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u0430\u0442\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435, \u043b\u0435\u0442\u044f\u0449\u0435\u043c \u043a \u0417\u0435\u043c\u043b\u0435.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/mtsexolve-examples\/asteroid-alert\/tree\/main\"><u>GitHub<\/u><\/a>.<\/p>\n<\/p>\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\/824772\/\"> https:\/\/habr.com\/ru\/articles\/824772\/<\/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>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043a\u043e\u0441\u043c\u043e\u0441 \u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0447\u0435\u0440\u0435\u0437 API \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e SMS \u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u044e\u0449\u0435\u043c\u0441\u044f \u043a \u0417\u0435\u043c\u043b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n<h3>NASA OpenAPI<\/h3>\n<p>NASA \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 15 \u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445! \u0412\u0441\u044f \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0448\u0438\u0440\u043e\u043a\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e API \u0430\u0433\u0435\u043d\u0442\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 API, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u043a\u0430\u043c\u0435\u0440\u0430 \u043f\u043e\u043b\u0438\u0445\u0440\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0417\u0435\u043c\u043b\u0438 (EPIC) \u2014 \u043f\u043e\u043b\u043d\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0438\u0441\u043a\u0430 \u0417\u0435\u043c\u043b\u0438:<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0440\u043e\u0434\u043d\u044b\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u043e\u0431\u0441\u0435\u0440\u0432\u0430\u0442\u043e\u0440\u0438\u0435\u0439 EONET \u2014 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u044b, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0440\u043e\u0434\u043d\u044b\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0448\u0442\u043e\u0440\u043c\u043e\u0432, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u0417\u0435\u043c\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0432\u0438\u0434\u0435\u043e NASA \u2014 \u0434\u043e\u0441\u0442\u0443\u043f \u043a <a href=\"https:\/\/images.nasa.gov\/#\/\"><u>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0432\u0438\u0434\u0435\u043e<\/u><\/a>;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0432\u0443\u043a\u0438 (\u0431\u0435\u0442\u0430-\u0432\u0435\u0440\u0441\u0438\u044f) \u2014 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0437\u0432\u0443\u043a\u0430\u043c \u0447\u0435\u0440\u0435\u0437 SoundCloud \u0441 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0448\u0443\u043c\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u0431\u043b\u0438\u0436\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 \u0417\u0435\u043c\u043b\u0451\u0439 (NeoWs) \u2014 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0440\u0436\u0430\u0442 \u043a\u0443\u0440\u0441 \u043d\u0430 \u043d\u0430\u0448\u0443 \u043f\u043b\u0430\u043d\u0435\u0442\u0443. \u042d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u043c \u0438 \u043d\u0443\u0436\u0435\u043d.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c NASA API<\/h3>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u043a\u0443 \u043c\u044b \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0432 <a href=\"https:\/\/hackernoon.com\/build-a-pyton-app-to-alert-you-for-asteroids-close-to-earth\"><u>\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 HackerNoon<\/u><\/a>. \u0418 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0433\u0438 \u0434\u043b\u044f \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438 \u0425\u0430\u0431\u0440\u0430.<\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443. \u041d\u0430 <a href=\"https:\/\/api.nasa.gov\/index.html\"><u>\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 NASA<\/u><\/a> \u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u0430\u0447\u0438 \u0437\u0430\u044f\u0432\u043a\u0438 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043b\u0438\u0447\u043d\u043e\u0433\u043e API-\u043a\u043b\u044e\u0447\u0430. \u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u044f\u0432\u043a\u0438 NASA \u043f\u0440\u0438\u0448\u043b\u0451\u0442 \u0432\u0430\u043c \u043a\u043b\u044e\u0447 \u043f\u043e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u0435.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u042d\u043a\u0440\u0430\u043d \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 API \u041d\u0410\u0421\u0410.<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 API \u0432 1\u00a0000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0447\u0430\u0441. \u041e\u043d\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u043d\u0435 \u0434\u043b\u044f \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u0446\u0435\u043b\u0435\u0439.<\/p>\n<h3>\u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 NASA API<\/h3>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 API, \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 (GET):<\/p>\n<ul>\n<li>\n<p>start_date (\u0413\u0413\u0413\u0413-\u041c\u041c-\u0414\u0414) \u2014 \u0434\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>end_date (\u0413\u0413\u0413\u0413-\u041c\u041c-\u0414\u0414) \u2014 \u0434\u0430\u0442\u0430 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>api_key \u2014 \u043a\u043b\u044e\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u043e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0442\u0432\u0435\u0442:<\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 JSON \u0441 \u0446\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<pre><code class=\"json\">{     \"links\": {         \"next\": \"http:\/\/api.nasa.gov\/neo\/rest\/v1\/feed?start_date=2023-10-17&amp;end_date=2023-10-17&amp;detailed=false&amp;api_key=8DaCUyeKqnNbupBJvDO42iUMS6tqfLFK4JjM263G\",         \"prev\": \"http:\/\/api.nasa.gov\/neo\/rest\/v1\/feed?start_date=2023-10-15&amp;end_date=2023-10-15&amp;detailed=false&amp;api_key=8DaCUyeKqnNbupBJvDO42iUMS6tqfLFK4JjM263G\",         \"self\": \"http:\/\/api.nasa.gov\/neo\/rest\/v1\/feed?start_date=2023-10-16&amp;end_date=2023-10-16&amp;detailed=false&amp;api_key=8DaCUyeKqnNbupBJvDO42iUMS6tqfLFK4JjM263G\"     },     \"element_count\": 10,     \"near_earth_objects\": {         \"2023-10-16\": [             {                 \"links\": {                     \"self\": \"http:\/\/api.nasa.gov\/neo\/rest\/v1\/neo\/2337558?api_key=8DaCUyeKqnNbupBJvDO42iUMS6tqfLFK4JjM263G\"                 },                 \"id\": \"2337558\",                 \"neo_reference_id\": \"2337558\",                 \"name\": \"337558 (2001 SG262)\",                 \"nasa_jpl_url\": \"http:\/\/ssd.jpl.nasa.gov\/sbdb.cgi?sstr=2337558\",                 \"absolute_magnitude_h\": 19.33,                 \"estimated_diameter\": {                     \"kilometers\": {                         \"estimated_diameter_min\": 0.3618719966,                         \"estimated_diameter_max\": 0.8091703835                     },                     \"meters\": {                         \"estimated_diameter_min\": 361.8719965994,                         \"estimated_diameter_max\": 809.1703835499                     },                     \"miles\": {                         \"estimated_diameter_min\": 0.2248567644,                         \"estimated_diameter_max\": 0.5027950104                     },                     \"feet\": {                         \"estimated_diameter_min\": 1187.2441213233,                         \"estimated_diameter_max\": 2654.758561166                     }                 },                 \"is_potentially_hazardous_asteroid\": true,                 \"close_approach_data\": [                     {                         \"close_approach_date\": \"2023-10-16\",                         \"close_approach_date_full\": \"2023-Oct-16 16:00\",                         \"epoch_date_close_approach\": 1697472000000,                         \"relative_velocity\": {                             \"kilometers_per_second\": \"20.8203253059\",                             \"kilometers_per_hour\": \"74953.171101087\",                             \"miles_per_hour\": \"46572.9856766726\"                         },                         \"miss_distance\": {                             \"astronomical\": \"0.2519750156\",                             \"lunar\": \"98.0182810684\",                             \"kilometers\": \"37694925.626976772\",                             \"miles\": \"23422540.6669605736\"                         },                         \"orbiting_body\": \"Earth\"                     }                 ],                 \"is_sentry_object\": false             },             [...]<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 near_earth_objects \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0434\u0435\u0442\u0430\u043b\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>estimated_diameter \u2014 \u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0432 \u043c\u0435\u0442\u0440\u0430\u0445, \u043a\u0438\u043b\u043e\u043c\u0435\u0442\u0440\u0430\u0445, \u043c\u0438\u043b\u044f\u0445 \u0438 \u0444\u0443\u0442\u0430\u0445<\/p>\n<\/li>\n<li>\n<p>relative_velocity \u2014 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>miss_distance \u2014 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u043e\u0440\u0431\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043b\u0430<\/p>\n<\/li>\n<li>\n<p>orbiting_body \u2014 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u044d\u0442\u043e \u0417\u0435\u043c\u043b\u044f, \u043d\u043e \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u043e\u0438\u0441\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>NASA API \u0434\u0430\u0451\u0442 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0440\u044f\u0434\u043e\u043c. \u041c\u044b \u043d\u0430\u0439\u0434\u0451\u043c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0438\u0437 \u043d\u0438\u0445, \u0447\u0442\u043e\u0431\u044b \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432 SMS. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e Python \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>requests<\/strong>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0451 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Python, \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0435\u0433\u043e \u0441 <a href=\"https:\/\/www.python.org\/downloads\/\"><u>\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430<\/u><\/a>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 requests, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:\u00a0<\/p>\n<pre><code class=\"python\">$ python -m pip install requests<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 alert.py. \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 requests, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 API. \u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 date \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f datetime, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044e\u044e \u0434\u0430\u0442\u0443:<\/p>\n<pre><code class=\"python\">import requests from datetime import date<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044e\u044e \u0434\u0430\u0442\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u043d\u0443\u0436\u043d\u043e\u043c \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 NASA:<\/p>\n<pre><code class=\"python\"># \u0421\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0434\u0430\u0442\u0430 todays_date = date.today().strftime(\"%Y-%m-%d\")<\/code><\/pre>\n<p>\u041f\u0440\u043e\u043f\u0438\u0448\u0438\u0442\u0435 API-\u043a\u043b\u044e\u0447 \u0438 URL-\u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a NASA API. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 API-\u043a\u043b\u044e\u0447 \u043d\u0443\u0436\u043d\u043e <a href=\"https:\/\/api.nasa.gov\/\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>:<\/p>\n<pre><code class=\"python\">nasa_api_key = \"NASA_API_KEY\" nasa_url = \"https:\/\/api.nasa.gov\/neo\/rest\/v1\/feed?start_date=\" + todays_date +\"&amp;end_date=\"+ todays_date + \"&amp;api_key=\"+nasa_api_key<\/code><\/pre>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 GET-\u0437\u0430\u043f\u0440\u043e\u0441 \u0432 NASA API \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0442\u0432\u0435\u0442 \u0432 JSON-\u0444\u043e\u0440\u043c\u0430\u0442:<\/p>\n<pre><code class=\"python\"># \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 NASA API \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u0432 JSON nasa_response = requests.get(nasa_url) json_nasa_response = nasa_response.json()<\/code><\/pre>\n<p>\u0412 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c \u043e\u0442 NASA \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u043a \u0417\u0435\u043c\u043b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 near_earth_objects. \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0432\u0441\u0435\u0445 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u043a \u0417\u0435\u043c\u043b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432:<\/p>\n<pre><code class=\"python\"># \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u043a \u0417\u0435\u043c\u043b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0432\u0441\u0435\u0445 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432 def find_closest_asteroid_index(near_asteroids):     # \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u044f \u0443\u0447\u0451\u0442\u0430 \u0434\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432 \u043e\u0442 \u0417\u0435\u043c\u043b\u0438     asteroids = []     # \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u044b \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 near_earth_objects     for i in range(0, len(near_asteroids)):         # \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u0417\u0435\u043c\u043b\u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432         asteroids.insert(i, near_asteroids[i]['close_approach_data'][0]['miss_distance']['kilometers'])     # \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441     # \u0438\u043d\u0434\u0435\u043a\u0441 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430 \u0432 near_earth_objects         return asteroids.index(min(asteroids))<\/code><\/pre>\n<h3>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0435<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 NASA API \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0431\u043b\u0438\u0437\u0438 \u0417\u0435\u043c\u043b\u0438 \u0435\u0441\u0442\u044c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u044b. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0435\u0441\u0442\u044c \u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 near_earth_objects \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043e\u0442 NASA API. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432 \u0438 \u043d\u0430\u0439\u0434\u0438\u0442\u0435 \u0438\u043d\u0434\u0435\u043a\u0441 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435:<\/p>\n<pre><code class=\"python\"># \u0415\u0441\u043b\u0438 \u043e\u043a\u043e\u043b\u043e \u0417\u0435\u043c\u043b\u0438 \u0435\u0441\u0442\u044c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u044b if \"near_earth_objects\" in json_nasa_response:     # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432     near_asteroids = json_nasa_response['near_earth_objects'][todays_date]     # \u0418\u043d\u0434\u0435\u043a\u0441 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430     closest_asteroid_index = find_closest_asteroid_index(near_asteroids)<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0432 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0438:<\/p>\n<pre><code class=\"python\">    # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0432 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0438     name = near_asteroids[closest_asteroid_index]['name'] #\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430     how_close = near_asteroids[closest_asteroid_index]['close_approach_data'][0]['miss_distance']['kilometers'] #\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0417\u0435\u043c\u043b\u0438     diameter =  near_asteroids[closest_asteroid_index]['estimated_diameter']['meters']['estimated_diameter_max'] #\u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0439\u0442\u0435 \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">    # \u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443     how_close_str = str(round(float(how_close)))     diameter_str = str(round(diameter))         # \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435     alert =\"\u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434 \u0441\u0435\u0433\u043e\u0434\u043d\u044f - \" + name + \". \u041e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \" + how_close_str + \" \u043a\u043c \u043e\u0442 \u0417\u0435\u043c\u043b\u0438. \u0415\u0433\u043e \u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \" + diameter_str + \" \u043c\u0435\u0442\u0440\u043e\u0432.\"<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/exolve.ru\/products\/sms-api\/?utm_source=habr&amp;utm_medium=refferal&amp;utm_campaign=sms_api_article&amp;utm_content=article_asteroid&amp;utm_term=sms_api_exolve\"><u>Exolve SMS API<\/u><\/a>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/exolve.ru\/products\/sms-api\/?utm_source=habr&amp;utm_medium=refferal&amp;utm_campaign=sms_api_article&amp;utm_content=article_asteroid&amp;utm_term=sms_api_exolve\"><u>\u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0432 MTC Exolve<\/u><\/a>;<\/p>\n<\/li>\n<li>\n<p>API-\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e API-\u043a\u043b\u044e\u0447, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/instructions\/creating-app\/\"><u>\u00ab\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u00bb<\/u><\/a> \u0438 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/instructions\/getting-api-key\/\"><u>\u00abAPI-\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u00bb<\/u><\/a>;<\/p>\n<\/li>\n<li>\n<p>\u043d\u043e\u043c\u0435\u0440 Exolve. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043a\u0443\u043f\u0438\u0442\u044c \u043d\u043e\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/instructions\/buying-number\/\"><u>\u00ab\u041f\u043e\u043a\u0443\u043f\u043a\u0430 \u043d\u043e\u043c\u0435\u0440\u0430\u00bb<\/u><\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043a\u043e\u0434 \u043d\u043e\u043c\u0435\u0440 Exolve, URL-\u0430\u0434\u0440\u0435\u0441, API-\u043a\u043b\u044e\u0447 \u0438 \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f:<\/p>\n<pre><code class=\"python\">    # \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Exolve     exolve_number = \"7999XXXXXXX\"     exolve_url = \"https:\/\/api.exolve.ru\/messaging\/v1\/SendSMS\"     recipient_number = \"7924XXXXXXX\"     exolve_api_key = \"EXOLVE_API_KEY\"<\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a Exolve API \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 requests, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0441\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u043d\u0435\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0435:<\/p>\n<pre><code class=\"python\">    # \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 EXOLVE SMS API \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-380075","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/380075","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=380075"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/380075\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=380075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=380075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=380075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}