{"id":327948,"date":"2022-01-13T15:00:58","date_gmt":"2022-01-13T15:00:58","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=327948"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=327948","title":{"rendered":"<span>\u00ab\u0410\u0444\u0438\u0448\u04307\u00bb \u2013 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c 4 API, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p><em>\u00ab\u041d\u0435 \u043f\u043e\u0440\u0430 \u043b\u0438, \u0434\u0440\u0443\u0437\u044c\u044f \u043c\u043e\u0438, \u043d\u0430\u043c \u0437\u0430\u043c\u0430\u0445\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u0412\u0438\u043b\u044c\u044f\u043c\u0430, \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u043b\u0438, \u043c-\u043c, \u043d\u0430\u0448\u0435\u0433\u043e \u0428\u0435\u043a\u0441\u043f\u0438\u0440\u0430?\u00bb<\/em>   <\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"442\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d8\/f04\/ca3\/9d8f04ca3846cf8ade9500f57480c9ce.png\" data-width=\"781\"\/><figcaption><\/figcaption><\/figure>\n<p>\u00ab<a href=\"https:\/\/afisha7.ru\" rel=\"noopener noreferrer nofollow\">\u0410\u0444\u0438\u0448\u04307<\/a>\u00bb \u2013 \u043f\u0440\u043e\u0435\u043a\u0442 \u043e \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u043d\u043e-\u0440\u0430\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u0420\u043e\u0441\u0441\u0438\u0438.   <\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u0434\u0435\u043a\u0430\u0431\u0440\u044f 2019 \u0433\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u043e \u043c\u043d\u043e\u0439 \u0441\u0442\u043e\u044f\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0440\u0430 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 2\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432: \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0439 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435, \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438 \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445.<\/p>\n<p>\u0412 \u043e\u0431\u0437\u043e\u0440\u0435 \u044f \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0448\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<h3>\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u041d\u043e\u0432\u043e\u0441\u0442\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b, \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043f\u043e\u0441\u0442\u0430\u043c\u0438 \u043e \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0445 \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u044f\u0445 \u0432 \u0433\u043e\u0440\u043e\u0434\u0435, \u0440\u0435\u0433\u0438\u043e\u043d\u0435. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0441\u0435\u0449\u0430\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u2013 \u0436\u0430\u043b\u044c, \u0447\u0442\u043e \u043d\u0435 \u0443\u0437\u043d\u0430\u043b \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u044c. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u043e\u0437\u0434\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0435\u0433\u043e \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0438, \u0438\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u043e\u0432. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043a\u0443\u0434\u0430 \u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0433\u043e\u0440\u043e\u0434\u0435, \u043d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u043e\u0442\u043f\u0443\u0441\u043a\u0435, \u043a\u043e\u043c\u0430\u043d\u0434\u0438\u0440\u043e\u0432\u043a\u0435.<\/p>\n<p>\u0422\u0430\u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0430\u043c\u0431\u0438\u0446\u0438\u043e\u0437\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u043d\u043e-\u0440\u0430\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.<\/p>\n<h3>\u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443 \u0420\u0424 \u0432 \u0435\u0434\u0438\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.<\/p>\n<h3>API PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444<\/h3>\n<p>\u041d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0432\u0441\u0435\u043c \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043c \u0420\u043e\u0441\u0441\u0438\u0438 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0440\u043e\u0435\u043a\u0442 PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 (\u0441 \u0434\u0435\u043a\u0430\u0431\u0440\u044f 2019 \u0433\u043e\u0434\u0430 \u043f\u043e\u0447\u0442\u0438 700 \u0442\u044b\u0441. \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439).<\/p>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u043c\u0435\u043d\u043d\u043e API PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0441\u0430\u0439\u0442\u0430, \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u2013 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432, \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043c\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u043c\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 \u0431\u044b\u043b\u0438 \u0432\u0437\u044f\u0442\u044b \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0441\u0430\u0439\u0442\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 API PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444<\/summary>\n<div class=\"spoiler__content\">\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 (\u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043c\u0435\u0441\u0442)<\/h4>\n<pre><code class=\"php\">function getCategories() { $countIns=0; $url='https:\/\/pro.culture.ru\/api\/2.4\/categories?apiKey='.OurAPIKEY.'&amp;limit=100'; foreach(['places', 'events'] as $type) { $response=file_get_contents($url.\"&amp;type=$type\"); if ($response) $arrType[$type]=json_decode($response); else $arrType[$type]=NULL; } foreach($arrType as $type=>$arr) { if($arr->categories) { $arrInsert=NULL; foreach($arr->categories as $obj) { if ($obj->_id>0 &amp;&amp; in_array($obj->type, ['places', 'events'])) $arrInsert[]=['cat_id'=>$obj->_id, 'name'=>$obj->name, 'url'=>$obj->sysName, 'num'=>$obj->index, 'type'=>$obj->type ]; } if ($arrInsert) { $countIns+=Yii::$app->db->createCommand()->batchInsert('nsi_categories', ['cat_id', 'name',  'url', 'num', 'type'], $arrInsert)->execute(); } } } return $countIns; }<\/code><\/pre>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u0435\u0439 (\u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432)<\/h4>\n<pre><code class=\"php\">function getlocales() { $maxRows=1000; $countIns=0; $url='https:\/\/pro.culture.ru\/api\/2.4\/locales?apiKey='.OurAPIKEY; $response=file_get_contents($url.'&amp;limit=1'); if ($response) $arrResponse=json_decode($response); if ($arrResponse) $count=$arrResponse->total; else return 0; unset($arrResponse); for($i=0; $i&lt;ceil($count\/$maxRows); $i++) { $arrInsert=NULL; $link=$url.'&amp;offset='.($i*$maxRows).\"&amp;limit=$maxRows\"; $response=json_decode(file_get_contents($link)); foreach($response->locales as $obj) { $arrInsert[]=['ids'=>$obj->_id, 'parent_id'=>$obj->parentId, 'name'=>$obj->name, 'url'=>$obj->sysName, 'population'=>$obj->population, 'fias_id'=>$obj->fias->_id, 'fias_name'=>$obj->fias->name, 'fias_level'=>$obj->fias->level ]; } if ($arrInsert) { $countIns+=Yii::$app->db->createCommand()->batchInsert('nsi_locales', ['ids', 'parent_id', 'name', 'url', 'population', 'fias_id', 'fias_name', 'fias_level'], $arrInsert)->execute(); } } return $countIns; }<\/code><\/pre>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u043c\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0439   <\/h4>\n<pre><code class=\"php\">function getPlaces() { $arr=NULL; $maxRows=100; $model=new Places(); $countIns=0; $url='https:\/\/pro.culture.ru\/api\/2.4\/places?apiKey='.OurAPIKEY.'&amp;sort=_id&amp;status=accepted'; if (Yii::$app->request->get('date')) $date=Yii::$app->request->get('date')*1000; if ($date) $url.='&amp;startUpdateDate='.$date; $response=file_get_contents($url'.&amp;limit=1'); if ($response) $arrResponse=json_decode($response); if ($arrResponse) $count=$arrResponse->total; else return 0; unset($arrResponse); $arrCats=(new Categories())->getcategories();\/\/\u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u043c\u0435\u0441\u0442 for($i=0; $i&lt;ceil($count\/$maxRows); $i++)\/\/\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 $arr[] - \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 $maxRows=100 { $link=$url.'&amp;offset='.($i*$maxRows).\"&amp;limit=$maxRows\"; $response=json_decode(file_get_contents($link)); $arrInsert=NULL; $arrCon=NULL; foreach($response->places as $obj) {\/\/\u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430 $arr=NULL; $strGallery='';\/\/\u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044f gallery $strAddress='';\/\/\u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044f address if ($obj->gallery) { $gal=$obj->gallery; foreach($gal as $row) $arrgg[]=$row->name; $strGallery=implode(',', $arrgg); $arrgg=NULL; } if ($obj->contacts) {\/\/\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 $arrCon \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 nsi_places_contacts foreach ($obj->contacts as $key=>$val) { if ($key=='phones') foreach($val as $phones) $arrCon[]=[$obj->_id, $phones->value, $phones->comment, $key]; else $arrCon[]=[$obj->_id, $val, '', $key]; } } if ($obj->address) {\/\/\u0444\u043e\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u044f address if ($obj->address->region) $strAddress.=$obj->address->region->name .' '. $obj->address->region->type .', '; if ($obj->address->area) $strAddress.=$obj->address->area->name .' '. $obj->address->area->type .', '; if ($obj->address->city) $strAddress.=$obj->address->city->type .'. '. $obj->address->city->name .', '; if ($obj->address->settlement) $strAddress.=$obj->address->settlement->type .'. '. $obj->address->settlement->name .', '; if ($obj->address->street) $strAddress.=$obj->address->street->type .'. '. $obj->address->street->name .', '; if ($obj->address->house) $strAddress.=$obj->address->house->name; $strAddress=trim($strAddress); $strAddress=rtrim($strAddress, '!,.-'); } if ($obj->workingSchedule) {\/\/\u0430\u043d\u0430\u043b\u0438\u0437 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \"\u0427\u0427:\u041c\u041c - \u0427\u0427:\u041c\u041c\" \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043d\u044f \u043d\u0435\u0434\u0435\u043b\u0438. for ($d=0; $d&lt;7; $d++ ) { $strSched='shed_'.$d; if ($obj->workingSchedule->$d) { $from=$obj->workingSchedule->$d->from; $to=$obj->workingSchedule->$d->to; if ($from*$to>0) { $from=$from\/60000; $fh=intval($from\/60); $fm=$from-$fh*60; $to=$to\/60000; $th=intval($to\/60); $tm=$to-$th*60; $$strSched=sprintf(\"%02d:%02d - %02d:%02d\", $fh, $fm, $th, $tm); } else $$strSched=''; } } } $arrInsert[]=['ids'=>$obj->_id, 'description'=>$obj->description, 'name'=>$obj->name, 'altname'=>$obj->altName, 'img_name'=>$obj->image->name, 'img_realname'=>$obj->image->realName, 'cat_id'=>$arrCats[$obj->category->sysName], 'gallery'=>$strGallery, 'locale_id'=>$obj->locale->_id, 'mapposition'=>implode('|', $obj->mapPosition->coordinates), 'status'=>$obj->status, 'updatedate'=>$obj->updateDate\/1000, 'address'=>$strAddress, 'shed_0'=>$shed_0,  'shed_1'=>$shed_1, 'shed_2'=>$shed_2, 'shed_3'=>$shed_3, 'shed_4'=>$shed_4, 'shed_5'=>$shed_5, 'shed_6'=>$shed_6];\/\/\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c } if ($arrInsert) { $countIns+=Yii::$app->db->createCommand()->batchInsert($model->tableName(), ['ids', 'description', 'name', 'altname', 'img_name', 'img_realname', 'cat_id', 'gallery', 'locale_id', 'mapposition', 'status', 'updatedate', 'address', 'shed_0', 'shed_1', 'shed_2', 'shed_3', 'shed_4', 'shed_5', 'shed_6'], $arrInsert)->execute();\/\/\u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 } if ($arrCon) { Yii::$app->db->createCommand()->batchInsert('nsi_places_contacts', ['con_ids', 'con_value', 'con_comm', 'slug' ], $arrCon)->execute();\/\/\u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 } } return $countIns; } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043b\u0438\u0448\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u0440\u043e\u0434\u043e\u0432 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0437\u0430 8 \u043c\u0435\u0441\u044f\u0446\u0435\u0432.<\/p>\n<p>\u0412 \u0430\u0432\u0433\u0443\u0441\u0442\u0435 2020 \u0433\u043e\u0434\u0430 \u00ab\u0410\u0444\u0438\u0448\u04307\u00bb \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 (\u043f\u043e\u0441\u0442 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0431\u043b\u043e\u0433\u0435 <a href=\"https:\/\/pro.culture.ru\/blog\/550\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<h3>\u041d\u0430\u0448\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438<\/h3>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 64 \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 500 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u043e 120 \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u0430\u043c. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u043e <a href=\"https:\/\/afisha7.ru\/uploads\/files\/instrukcia-po-rabote-s-afisa7.pdf\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0448\u043b\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043a\u0430\u043a \u043a\u0438\u043d\u043e, \u0446\u0438\u0440\u043a, \u0441\u043f\u043e\u0440\u0442, \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0430\u0442\u0440\u044b, \u043a\u043e\u043d\u0446\u0435\u0440\u0442\u044b.<\/p>\n<p>\u041d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u043e, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0430\u043b \u043e\u0431\u044f\u0437\u0430\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043e\u043d\u043b\u0430\u0439\u043d \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u0431\u0438\u043b\u0435\u0442\u043e\u0432.<\/p>\n<h3>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f API \u00abRambler-\u043a\u0430\u0441\u0441\u0430\u00bb \u0438 \u00ab\u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0430\u00bb<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u043a\u0438\u043d\u043e, \u0441\u043f\u043e\u0440\u0442, \u0442\u0435\u0430\u0442\u0440\u044b, \u043a\u043e\u043d\u0446\u0435\u0440\u0442\u044b) \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441 \u00ab\u0420\u0430\u043c\u0431\u043b\u0435\u0440-\u043a\u0430\u0441\u0441\u0430\u00bb, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438 \u00ab\u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0430\u00bb.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 API \u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0438<\/summary>\n<div class=\"spoiler__content\">\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0432\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/h4>\n<pre><code class=\"php\">function getYandexJson($ticket) {$res=NULL; $path=BASE_PATH . '\/json\/ya\/'; $fn='new.gz'; $ffn=$path.$fn; $url='https:\/\/afisha.yandex.ru\/export\/json'; $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Token '.OurAPIKEY]); curl_setopt($curl, CURLOPT_URL, $url); $out = curl_exec($curl); curl_close($curl); $json=json_decode($out); if ($json[0]->url) { $ReadFile = fopen ($json[0]->url, \"rb\"); if ($ReadFile) { $WriteFile = fopen ($ffn, \"wb\"); if ($WriteFile) { while(!feof($ReadFile)) { fwrite($WriteFile, fread($ReadFile, 4096 )); } fclose($WriteFile); } fclose($ReadFile); } if (file_exists($ffn)) { $command='tar xzvpf '.$ffn.' -C '.$path; $res=shell_exec($command); } } return $res; }<\/code><\/pre>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0441\u0442<\/h4>\n<pre><code class=\"php\">function getPlacesYa($cityid=0) { $path=BASE_PATH . '\/json\/ya\/'; $countInsert=0; $errors=NULL; $success=NULL; $filename='venues.json'; $arrCities=Nsicities()::getCities(); $arrPlaces=Nsiplaces::getPlaces(); $cities=scandir($path); foreach($cities as $townid) { $arrInsert=NULL; if (in_array($townid, $arrCities) &amp;&amp; file_exists($path.$townid.'\/'.$filename)) { $json=file_get_contents($path.$townid.'\/'.$filename); $arr=json_decode($json); foreach($arr as $obj) { $arrPhones=NULL; $strPhones=''; $arrMetro=NULL; $strMetro=''; $longitude='0'; $latitude='0'; $strTags='prochee'; $strLogo=''; $strLinks=''; $strSynonyms=''; if (in_array($obj->id, $arrPlaces[$townid])) continue; if ($obj->metro)  { foreach($obj->metro as $om) { if ($om->name!='null') $arrMetro[]=$om->line_color.','.$om->name; } $strMetro=implode('|',$arrMetro); } if ($obj->phones) { foreach($obj->phones as $oph) { $arrPhones[]=$oph->text; } $strPhones=implode(',', $arrPhones); } if ($obj->links) $strLinks=implode('|', $obj->links); if ($obj->synonyms) $strSynonyms=implode('|', $obj->synonyms); if ($obj->location) { $latitude=$obj->location[1]; $longitude=$obj->location[0]; } if ($obj->tags) { $strTags=implode('|', $obj->tags); } if ($obj->image->origin_url &amp;&amp; $obj->image->type=='image') $strLogo=$obj->image->origin_url; $arrInsert[]=[$obj->id, $obj->city_id, $obj->url, $obj->capacity, $obj->description, $obj->title, $strSynonyms, $longitude, $latitude, $obj->address, $strLogo, $strLinks, $strPhones, $strMetro, $strTags];  } if ($arrInsert) { $countInsert+=Yii::$app->db->createCommand()->batchInsert('nsi_places_ya', ['id_ya', 'city_id', 'url', 'capacity', 'description', 'title', 'synonyms', 'longitude', 'latitude', 'address', 'logo', 'links', 'phones', 'metro', 'tags'], $arrInsert)->execute(); } } } return $countInsert; }<\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 API Rambler-\u043a\u0430\u0441\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0433\u043e\u0440\u043e\u0434\u043e\u0432<\/h4>\n<pre><code class=\"php\">public function getCitiesRb() { $arrInsert=NULL; $count=0; $url='http:\/\/api.kassa.rambler.ru\/v3\/cities?WidgetKey='.MyWidgetKey; $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-ApiAuth-PartnerKey: '.MyPartnerKey]); curl_setopt($curl, CURLOPT_URL, $url); $out = curl_exec($curl); $cities=json_decode($out); curl_close($curl); foreach ($cities as $city) { $arrInsert[]=[$city->Id, $city->Name, $city->Coordinates->Latitude, $city->Coordinates->Longitude]; } if ($arrInsert)$count=Yii::$app->db->createCommand()->batchInsert('nsi_cities', ['id', 'name', 'latitude', 'longitude'], $arrInsert)->execute(); return $count; }<\/code><\/pre>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0441\u0442<\/h4>\n<pre><code class=\"php\">function getPlacesrb() { $count=0; $cities=Nsicities::getCities(); $arrPlaces=Nsiplaces::getPlacesRb(); if($cities ) { foreach ($cities as $city) { $arrInsert=NULL; $curl = curl_init(); $url='http:\/\/api.kassa.rambler.ru\/v3\/places?CityId='.$city['id'].'&amp;WidgetKey='.MyWidgetKey; curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-ApiAuth-PartnerKey: '.MyApiKey]); curl_setopt($curl, CURLOPT_URL, $url); $out = curl_exec($curl); curl_close($curl); if ($out) { $arr=json_decode($out); foreach($arr as $obj) { $lat=''; $long=''; $hascodescanner=0; $metro=''; $phones=''; $cinemachain=''; if ($obj->Id) { if (in_array($obj->Id, $arrPlaces)) continue; if ($obj->Coordinates->Latitude) $lat=$obj->Coordinates->Latitude; if ($obj->Coordinates->Longitude) $long=$obj->Coordinates->Longitude; if ($obj->HasCodeScanner) $hascodescanner=1; if ($obj->MetroStations) $metro=json_encode($obj->MetroStations, JSON_UNESCAPED_UNICODE); if ($obj->Phones) $phones=json_encode($obj->Phones, JSON_UNESCAPED_UNICODE); if ($obj->CinemaChain) $cinemachain=json_encode($obj->CinemaChain, JSON_UNESCAPED_UNICODE);  $arrInsert[]=[$obj->Id, $obj->CityId, $obj->Type, $obj->Name, $obj->Address, $lat, $long, $metro, $phones, $obj->ImageUrl, $hascodescanner, $cinemachain]; } } if ($arrInsert) $count+=Yii::$app->db->createCommand()->batchInsert('nsi_places_rb', ['id', 'city_id', 'type', 'name', 'address', 'latitude', 'longitude', 'metro', 'phones', 'img', 'hascodescanner', 'cinemachain'], $arrInsert)->execute(); } } } return $count; }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u2013 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0432 \u0435\u0434\u0438\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u00ab\u0410\u0444\u0438\u0448\u04307\u00bb \u0441 \u00abRambler-\u043a\u0430\u0441\u0441\u0430\u00bb \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c API \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0431\u044b\u043b\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e \u0431\u043e\u043b\u0435\u0435 40 \u0442\u044b\u0441\u044f\u0447 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0431\u0438\u043b\u0435\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0432\u0438\u0434\u0436\u0435\u0442\u044b.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u00ab\u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0430\u00bb \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e \u043d\u0430 \u0441\u0430\u0439\u0442 \u043f\u043e\u0447\u0442\u0438 70 \u0442\u044b\u0441\u044f\u0447 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442 \u043e\u043d\u043b\u0430\u0439\u043d \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0431\u0438\u043b\u0435\u0442\u043e\u0432.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 API.<\/p>\n<h3>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 API \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/h3>\n<p>\u041d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f API \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0420\u0424<\/p>\n<\/li>\n<li>\n<p>Rambler-\u043a\u0430\u0441\u0441\u0430<\/p>\n<\/li>\n<li>\n<p>\u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 JSON, \u0447\u0442\u043e \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0438\u0445 API \u2013 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435.<\/p>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 API PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0430 \u0441\u043e\u0431\u043e\u0439 PDF \u0444\u0430\u0439\u043b \u0441 \u043a\u0440\u0430\u0442\u043a\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438.<\/p>\n<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f.<\/p>\n<p>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f API \u2013 2.5.<\/p>\n<p>API \u0420\u0430\u043c\u0431\u043b\u0435\u0440-\u043a\u0430\u0441\u0441\u0430 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a \u043d\u0438\u043c, \u043d\u043e \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a API \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435.<\/p>\n<p>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f API \u2013 3.0.<\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 API \u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0438 \u0432\u044b\u0441\u044b\u043b\u0430\u044e\u0442 \u043f\u043e \u043f\u043e\u0447\u0442\u0435 \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u043e\u0434\u043e\u0431\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u044f\u0432\u043a\u0438 \u043d\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432 \u0444\u043e\u0440\u043c\u0435 \u00ab\u0410\u0444\u0438\u0448\u0430: \u041a\u0430\u043a \u0441\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u043e\u043c\u00bb.<\/p>\n<p>\u0412\u0441\u0435 API \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0430\u0440\u0445\u0438\u0432\u0443 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u0435\u0440\u0438\u043e\u0434, \u0433\u0434\u0435 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0430\u0440\u0445\u0438\u0432\u0430 \u0444\u0430\u0439\u043b\u044b \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0441 \u0433\u043e\u0440\u043e\u0434\u0430\u043c\u0438, \u0442\u0435\u0433\u0430\u043c\u0438, \u0430 \u0432 \u043f\u0430\u043f\u043a\u0430\u0445, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 id \u0433\u043e\u0440\u043e\u0434\u0430: \u0444\u0430\u0439\u043b\u044b \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438, \u043c\u0435\u0441\u0442\u0430\u043c\u0438, \u0441\u0435\u0430\u043d\u0441\u0430\u043c\u0438, \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0430\u043c\u0438 \u0432 \u0433\u043e\u0440\u043e\u0434\u0435.<\/p>\n<p>\u041e\u0442\u043c\u0435\u0442\u0438\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a API \u0420\u0430\u043c\u0431\u043b\u0435\u0440-\u043a\u0430\u0441\u0441\u044b \u0438 \u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0438 \u2013 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043c\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f. \u0410 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043f\u0440\u0438 \u0432\u044b\u0434\u0430\u0447\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0434\u0430\u044e\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430, PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u0443 \u0438 \u0434\u0430\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a \u0438 \u043e\u0431\u044a\u0435\u043c \u041e\u0417\u0423, \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h3>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0424\u0438\u043d\u0438\u0448\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0441\u044f \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0431\u043e\u0440\u044c\u0431\u0435 \u0441 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c \u0438 \u043c\u0435\u0441\u0442\u0430\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 (\u043e\u0441\u043e\u0431\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u2013 \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u043b\u0438 \u043c\u0435\u0441\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0448\u043b\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444, Rambler-\u043a\u0430\u0441\u0441\u0430, \u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e).<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043c\u044b \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u0444\u0438\u043b\u044c\u043c\u044b \u2013 \u0431\u043e\u043b\u0435\u0435 3500 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0438 \u043c\u0435\u0441\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0439 \u2013 \u0431\u043e\u043b\u0435\u0435 40000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0412\u043d\u0435\u0434\u0440\u0438\u043b\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0438\u0445 \u0441\u0435\u0430\u043d\u0441\u043e\u0432 \u0438 \u043c\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u0434\u0430\u0447\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0438 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u00ab<a href=\"https:\/\/beget.com\/p119516\" rel=\"noopener noreferrer nofollow\">Beget<\/a>\u00bb, \u0437\u0430 \u0447\u0442\u043e \u0435\u0439 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e.<\/p>\n<h3>\u0421\u0442\u0435\u043a \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439<\/h3>\n<p>PHP7.1, MySQL\u00a05.7, Yii2, JSCript, Bootstrap\u00a03.<\/p>\n<h3>\u041c\u043e\u043d\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0414\u043b\u044f \u043c\u043e\u043d\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 API, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0412\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u0435\u00a0API, \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c API \u00ab\u0410\u0444\u0438\u0448\u04307\u00bb \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>API \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 json \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u043e API-key, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f API \u0410\u0444\u0438\u0448\u04307:<\/summary>\n<div class=\"spoiler__content\">\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/h4>\n<pre><code class=\"php\">function getCategoriesEvents($all=FALSE) { if (!$all) $where=\" where  v=1 \"; else $where=\"where 1 \"; $where.=' and type=\"events\" '; $sql='select * from nsi_categories '.$where.' order by name'; $rows=$this->db->query($sql); while ($row=$rows->fetch_assoc()) { $res[]=$row; } return $res; }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u0435\u0439 (\u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432)<\/p>\n<pre><code class=\"php\">function getLocales() { $where =' where fias_level in (1, 3) '; $sql='select * from nsi_locales '.$where.' order by name'; $rows=$this->db->query($sql); $total=0; while ($row=$rows->fetch_assoc()) { $res[$row['level']][]=$row; $total++; } if ($total>0) return ['total'=>$total, 'level'=>$res]; else return NULL; }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/p>\n<pre><code class=\"php\">function getEvs($loc_id=0, $cat_id=0, $limit=20, $offset=0, $from=0, $to=0) { $loc_id=$loc_id*1; $cat_id=$cat_id*1; $limit=$limit*1; $offset=$offset*1; $from=$from*1; $to=$to*1;  if ($loc_id>0) { if ($offset) $strOffset=\" OFFSET $offset \"; else $strOffset=''; if ($limit>100) return ['errors'=>'Maximum number of records 100']; elseif ($limit==0) $limit=20; $strLimit=\" limit $limit \"; $where=' e.locale_id='.$loc_id; if ($cat_id) $where.=\" and e.cat_id=$cat_id\"; if($to+$from>0) {if ($to>0) { if ($from>0) $where.=\" and ((e.date_end>=$from and e.date_start&lt;=$to) or e.date_end=0)\"; } else $where.=\" and ((e.date_end>=$from) or e.date_end=0)\"; } } else return ['errors'=>['Not specified code of LOCALE.']]; $sql=\"SELECT e.* FROM evs e WHERE $where ORDER BY e.date_start, e.date_end\"; $count=$this->db->query(\"select count(*) from ($sql) c \"); $total=$count->fetch_array()[0]; if ($total) { $rows=$this->db->query($sql.$strLimit.$strOffset); while ($row=$rows->fetch_assoc()) { $anons=strip_tags(trim($row['anons'] ? $row['anons'] : $row['description'])); $len = strlen($anons); $anons = ( ($len > 150) &amp;&amp; ($len != 0) ) ? rtrim(mb_strimwidth($anons, 0, 150 - strlen('\u2026'))) . '\u2026' : $anons; if ($row['logo'] &amp;&amp; $row['pref']=='mk')  { $pic=explode('.', $row['logo']); $strLogo='https:\/\/mk.mrgcdn.ru\/'.$pic[0].'_w720_h540.'.$pic[1]; $strLogo_p='https:\/\/mk.mrgcdn.ru\/'.$pic[0].'.'.$pic[1]; } elseif($row['logo'] &amp;&amp; ($row['pref']=='rf' || $row['pref']=='af')) { $strLogo='https:\/\/afisha7.ru'.$row['logo']; $strLogo_p=$strLogo; } else { $strLogo=$row['logo']; $strLogo_p=$strLogo; } $strLogo_p=str_replace(['films\/rb_', 'films\/rf_', 'films\/af_', 'films\/ya_'], 'films\/preview\/p_', $strLogo_p); if (substr($strLogo, 0, 8)!='https:\/\/') $strLogo='https:\/\/afisha7.ru'.$strLogo; if (substr($strLogo_p, 0, 8)!='https:\/\/') $strLogo_p='https:\/\/afisha7.ru'.$strLogo_p; $res[]=['id'=>$row['id'], 'idfull'=>$row['idfull'], 'pref'=>$row['pref'],'cat_id'=>$row['cat_id'],'loc_id'=>$row['loc_id'], 'name'=>$row['name'], 'date_start'=>$row['date_start'], 'date_end'=>$row['date_end'], 'logo'=>$strLogo, 'logo_p'=>$strLogo_p, 'anons'=>$anons, 'age'=>$row['age_name']];\/\/, 'places'=>$arrPlaces]; } return ['total'=>$total, 'events'=>$res, ]; } else return NULL; }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 API \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430: \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u0411\u0414 \u043d\u0435\u0442. \u0411\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u0432 json-\u0444\u0430\u0439\u043b, \u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u0442\u0443 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u0435\u0439<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">if ($_POST['APIKey']) { if (!(file_exists('locales.json'))) { $arr=APIAfisha7::getLocales(); if ($arr) { $arr['lastdate']=time()+5*60; $str=json_encode($arr, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); unset($arr); file_put_contents('locales.json', $str); echo $str; } else echo json_encode(['errors'=>\"not records\"], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } else { if($_POST['lastdate']) { $ld=$_POST['lastdate']*1; if ($ld>=filemtime( __DIR__.'\/locales.json')) echo json_encode(['errors'=>\"No updates for locales\"], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); else echo file_get_contents('locales.json'); } else echo file_get_contents('locales.json'); } } else { echo json_encode(['errors'=>[\"Not APIKey\", 'Only POST request.']], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); }<\/code><\/pre>\n<\/div>\n<\/details>\n<h3>\u0412\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u0435\u00a0API<\/h3>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0412\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u0435\u00a0API \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0438 \u0430\u043d\u043e\u043d\u0441\u0430\u043c\u0438 \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0439.<\/p>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e\u0442\u0441\u044f \u0432 12 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430\u0445 \u0430\u043d\u043e\u043d\u0441\u044b: \u0443\u0442\u0440\u043e\u043c \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0438 \u0432\u0435\u0447\u0435\u0440\u043e\u043c \u043d\u0430 \u0437\u0430\u0432\u0442\u0440\u0430; \u043a\u0438\u043d\u043e\u0430\u0444\u0438\u0448\u0430 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f, \u0442\u0440\u0435\u0439\u043b\u0435\u0440\u044b \u043d\u043e\u0432\u0438\u043d\u043e\u043a \u043a\u0438\u043d\u043e, \u0430\u0444\u0438\u0448\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0440\u0443\u0447\u043d\u0430\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 API, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f Wiki-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u043e\u0433\u043e\u0442\u0438\u043f\u043e\u0432 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e, \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u043e\u0441\u0442\u0430\u0445 \u043e\u0431 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c.<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u0432 \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">function publicPhotoArr($arr=NULL, $cat_url='') { $ret=FALSE; $arrRet=NULL; $arrLogos=NULL; $path=dirname(__DIR__); $vk=new \\VK\\Client\\VKApiClient('5.131'); if ($arr &amp;&amp; $cat_url) { $arrAlbums=$this->publicGetAlbums(['group_id'=>-$vk->vkkey['groups_ids'],]); $album_id=$arrAlbums[$cat_url]; if (!($album_id)) return 0; $i=0; $arrFiles=NULL; $retServer=$vk->photos()->getUploadServer( $this->accessToken, [ 'group_id'=>$this->vkkey['groups_ids'], 'album_id'=>$album_id, ] ); foreach ($arr as $kk=>$row) { if (substr($row['logo'],0, 8)=='\/uploads') { $logo=$row['logo']; } elseif ($row['ev_id_postfix']=='mk') { $pic=explode('.', $row['logo']); $fname='https:\/\/mk.mrgcdn.ru\/'.$pic[0].'_w720_h540.'.$pic[1]; $logo=\\admin\\helpers\\Image::upload_from_url($fname, $row['ev_id_char'], 'gallery\/vkpub\/mk', 720);\/\/, 1024); } else $logo=\\admin\\helpers\\Image::upload_from_urlWithOutDimentions($row['logo'], $row['ev_id_char'], 'gallery\/vkpub\/'.$row['ev_id_postfix'], 1024); $i++; $arrFiles['file'.$i]=new \\CURLFile($path.$logo); $arrLogos[]=[$logo, $row['ev_id_char']]; if ($i==5) {    $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $retServer['upload_url']); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $arrFiles); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = json_decode(curl_exec($ch)); curl_close($ch); sleep(3); $ret=$vk->photos()->save( $this->accessToken, [ 'group_id'=>$this->vkkey['groups_ids'], 'album_id'=>$album_id, 'server'=>$result->server, 'aid'=>$result->aid, 'hash'=>$result->hash, 'photos_list'=>$result->photos_list, ] ); if ($ret) { foreach($ret as $k=>$photos) $arrRet[]=['id'=>$photos['id'], 'logo'=>$arrLogos[$k][0], 'ev_id_char'=>$arrLogos[$k][1], 'album_id'=>$album_id]; } $i=0; $arrFiles=NULL; $arrLogos=NULL; } } if ($i>0 &amp;&amp; $arrFiles) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $retServer['upload_url']); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $arrFiles); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = json_decode(curl_exec($ch)); curl_close($ch); $ret=$vk->photos()->save( $this->accessToken, [ 'group_id'=>$this->vkkey['groups_ids'], 'album_id'=>$album_id, 'server'=>$result->server, 'aid'=>$result->aid, 'hash'=>$result->hash, 'photos_list'=>$result->photos_list, ] ); if ($ret) { foreach($ret as $k=>$photos) $arrRet[]=['id'=>$photos['id'], 'logo'=>$arrLogos[$k][0], 'ev_id_char'=>$arrLogos[$k][1], 'album_id'=>$album_id]; } } } return $arrRet; }<\/code><\/pre>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0442\u0440\u0435\u0439\u043b\u0435\u0440\u043e\u0432 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0432 \u043f\u043b\u0435\u0439-\u043b\u0438\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u043e\u0441\u0442\u0430\u0445 \u043e \u043d\u043e\u0432\u0438\u043d\u043a\u0430\u0445 \u0444\u0438\u043b\u044c\u043c\u043e\u0432, \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043a \u043f\u043e\u043a\u0430\u0437\u0443 \u0432 \u0433\u043e\u0440\u043e\u0434\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430.<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u0438\u0434\u0435\u043e \u0432 \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">function publicVideo($arr=NULL) { $ret=FALSE; $link=''; $path=dirname(__DIR__).'\/..\/public_html'; $vk=new \\VK\\Client\\VKApiClient('5.131'); if ($arr) { foreach ($arr as $k=>$v) $$k=$v; $retAlbums=$vk->publicGetPlaylists(['group_id'=>-$vk->vkkey['groups_ids'],]); if ($retAlbums['items']) { $album_id=$retAlbums['items'][0]['id']; } else return NULL; $arrFiles=NULL; $retServer=$vk->video()->save( $this->accessToken, [ 'group_id'=>$this->vkkey['groups_ids'], 'album_id'=>$album_id, 'name'=>'\u0422\u0440\u0435\u0439\u043b\u0435\u0440 \u0444\u0438\u043b\u044c\u043c\u0430 - '.$name, 'description'=>$anons, 'wallpost'=>0, 'no_comments'=>1, 'compression'=>1, ] ); if ($retServer['upload_url']) { if (substr($trailer,0, 8)!='\/uploads') { $ff=fopen($trailer, 'rb'); $fp = fopen($path.'\/video.mp4', 'w+'); $kol=stream_copy_to_stream($ff, $fp); fclose($fp); fclose($ff); if ($kol) $trailer='\/video.mp4'; else return NULL; } $arrFiles=['video_file'=>new \\CURLFile($path.$trailer)]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $retServer['upload_url']); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $arrFiles); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $ret = json_decode(curl_exec($ch)); curl_close($ch); if ($ret->owner_id * $ret->video_id *(-1)>0) { $link=\"https:\/\/vk.com\/video\".$ret->owner_id.'_'.$ret->video_id; } } } return $link; }<\/code><\/pre>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0442\u0435\u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432 \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f. <\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u2013 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0412\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u0435 API \u0438 \u00ab\u043d\u0435\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u00bb \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u0442\u043e\u0434 video.save() \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0440\u043e\u043b\u0438\u043a\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u043d\u043e \u043b\u0438\u0448\u044c \u0441 \u0438\u0437\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0439\u0442\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u043e\u043b\u0438\u043a\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0443 \u0432 \u0412\u041a; \u043c\u0435\u0442\u043e\u0434 photos.save() \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043e\u0442 1 \u0434\u043e 5 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435).<\/p>\n<h3>\u041a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044f<\/h3>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u043f\u0440\u043e\u0435\u043a\u0442, \u043c\u044b \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043e\u0442\u0434\u0430\u0432\u0430\u043b\u0438 \u043e\u0442\u0447\u0435\u0442 \u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u0438. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u0440\u0443\u043f\u043d\u043e\u043c \u0433\u043e\u0440\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u0444\u0438\u0448\u0430, \u0430 \u0442\u043e \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u043c\u0435\u0434\u0438\u0430-\u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438:<\/p>\n<p><a href=\"https:\/\/www.culture.ru\/\" rel=\"noopener noreferrer nofollow\">https:\/\/www.culture.ru\/<\/a> &#8212; \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u041c\u0438\u043d\u041a\u0443\u043b\u044c\u0442\u0430 \u0420\u0424. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041f\u0440\u043e\u0434\u0430\u0436\u0430 \u0431\u0438\u043b\u0435\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0441\u0430\u0439\u0442\u044b.<\/p>\n<p><a href=\"https:\/\/afisha.yandex.ru\" rel=\"noopener noreferrer nofollow\">https:\/\/afisha.yandex.ru<\/a> \u2013 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043d\u0430 \u0441\u0435\u0430\u043d\u0441\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0434\u0430\u044e\u0442 \u0431\u0438\u043b\u0435\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0438.<\/p>\n<p><a href=\"https:\/\/kassa.rambler.ru\" rel=\"noopener noreferrer nofollow\">https:\/\/kassa.rambler.ru<\/a> \u2013 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0434\u0430\u044e\u0442 \u0431\u0438\u043b\u0435\u0442\u044b \u043d\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0435 Rambler-\u043a\u0430\u0441\u0441\u0430.<\/p>\n<p><a href=\"http:\/\/www.afisha.ru\/\" rel=\"noopener noreferrer nofollow\">http:\/\/www.afisha.ru\/<\/a> \u2013 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043a\u0440\u0443\u043f\u043d\u044b\u043c \u0433\u043e\u0440\u043e\u0434\u0430\u043c, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u0431\u043b\u0430\u0441\u0442\u043d\u044b\u0435 \u0446\u0435\u043d\u0442\u0440\u044b. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<p><a href=\"https:\/\/gorodzovet.ru\" rel=\"noopener noreferrer nofollow\">https:\/\/gorodzovet.ru<\/a> \u2013 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043b\u044f 149 \u0433\u043e\u0440\u043e\u0434\u043e\u0432. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0444\u0438\u043b\u044c\u043c\u044b, \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<p><a href=\"https:\/\/kudago.com\/\" rel=\"noopener noreferrer nofollow\">https:\/\/kudago.com\/<\/a> \u2013 \u0442\u043e\u043b\u044c\u043a\u043e 9 \u043a\u0440\u0443\u043f\u043d\u0435\u0439\u0448\u0438\u0445 \u0433\u043e\u0440\u043e\u0434\u043e\u0432 \u0420\u043e\u0441\u0441\u0438\u0438. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<p><a href=\"https:\/\/www.kassir.ru\/\" rel=\"noopener noreferrer nofollow\">https:\/\/www.kassir.ru\/<\/a> \u2013 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0430\u043c\u0438 \u043f\u0440\u043e\u0434\u0430\u044e\u0442 \u0431\u0438\u043b\u0435\u0442\u044b. \u0422\u043e\u043b\u044c\u043a\u043e 75 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0433\u043e\u0440\u043e\u0434\u043e\u0432 \u0420\u043e\u0441\u0441\u0438\u0438.<\/p>\n<p><a href=\"https:\/\/www.kinoafisha.info\/\" rel=\"noopener noreferrer nofollow\">https:\/\/www.kinoafisha.info\/<\/a> \u2013 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0438\u043b\u044c\u043c\u044b. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432.<\/p>\n<h3>\u041d\u0430\u0448\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/h3>\n<ul>\n<li>\n<p>\u041e\u0445\u0432\u0430\u0447\u0435\u043d\u043e \u0431\u043e\u043b\u0435\u0435 2000 \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0411\u043e\u043b\u0435\u0435 40 \u0442\u044b\u0441\u044f\u0447 \u043c\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0439, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043f\u043e 10 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043e\u043d\u043b\u0430\u0439\u043d \u043f\u043e\u043a\u0443\u043f\u043a\u0430 \u0431\u0438\u043b\u0435\u0442\u043e\u0432 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u0432\u0438\u0434\u0436\u0435\u0442\u044b Rambler-\u043a\u0430\u0441\u0441\u044b \u0438\u043b\u0438 \u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/645429\/\"> https:\/\/habr.com\/ru\/post\/645429\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p><em>\u00ab\u041d\u0435 \u043f\u043e\u0440\u0430 \u043b\u0438, \u0434\u0440\u0443\u0437\u044c\u044f \u043c\u043e\u0438, \u043d\u0430\u043c \u0437\u0430\u043c\u0430\u0445\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u0412\u0438\u043b\u044c\u044f\u043c\u0430, \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u043b\u0438, \u043c-\u043c, \u043d\u0430\u0448\u0435\u0433\u043e \u0428\u0435\u043a\u0441\u043f\u0438\u0440\u0430?\u00bb<\/em>   <\/p>\n<\/blockquote>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u00ab<a href=\"https:\/\/afisha7.ru\" rel=\"noopener noreferrer nofollow\">\u0410\u0444\u0438\u0448\u04307<\/a>\u00bb \u2013 \u043f\u0440\u043e\u0435\u043a\u0442 \u043e \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u043d\u043e-\u0440\u0430\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u0420\u043e\u0441\u0441\u0438\u0438.   <\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u0434\u0435\u043a\u0430\u0431\u0440\u044f 2019 \u0433\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u043e \u043c\u043d\u043e\u0439 \u0441\u0442\u043e\u044f\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0440\u0430 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 2\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432: \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0439 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435, \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438 \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445.<\/p>\n<p>\u0412 \u043e\u0431\u0437\u043e\u0440\u0435 \u044f \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0448\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<h3>\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u041d\u043e\u0432\u043e\u0441\u0442\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b, \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043f\u043e\u0441\u0442\u0430\u043c\u0438 \u043e \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0445 \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u044f\u0445 \u0432 \u0433\u043e\u0440\u043e\u0434\u0435, \u0440\u0435\u0433\u0438\u043e\u043d\u0435. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0441\u0435\u0449\u0430\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u2013 \u0436\u0430\u043b\u044c, \u0447\u0442\u043e \u043d\u0435 \u0443\u0437\u043d\u0430\u043b \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u044c. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u043e\u0437\u0434\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0435\u0433\u043e \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0438, \u0438\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u043e\u0432. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043a\u0443\u0434\u0430 \u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0433\u043e\u0440\u043e\u0434\u0435, \u043d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u043e\u0442\u043f\u0443\u0441\u043a\u0435, \u043a\u043e\u043c\u0430\u043d\u0434\u0438\u0440\u043e\u0432\u043a\u0435.<\/p>\n<p>\u0422\u0430\u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0430\u043c\u0431\u0438\u0446\u0438\u043e\u0437\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u043d\u043e-\u0440\u0430\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.<\/p>\n<h3>\u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443 \u0420\u0424 \u0432 \u0435\u0434\u0438\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.<\/p>\n<h3>API PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444<\/h3>\n<p>\u041d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0432\u0441\u0435\u043c \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043c \u0420\u043e\u0441\u0441\u0438\u0438 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0440\u043e\u0435\u043a\u0442 PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 (\u0441 \u0434\u0435\u043a\u0430\u0431\u0440\u044f 2019 \u0433\u043e\u0434\u0430 \u043f\u043e\u0447\u0442\u0438 700 \u0442\u044b\u0441. \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439).<\/p>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u043c\u0435\u043d\u043d\u043e API PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0441\u0430\u0439\u0442\u0430, \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u2013 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432, \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043c\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u043c\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 \u0431\u044b\u043b\u0438 \u0432\u0437\u044f\u0442\u044b \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0441\u0430\u0439\u0442\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 API PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444<\/summary>\n<div class=\"spoiler__content\">\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 (\u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043c\u0435\u0441\u0442)<\/h4>\n<pre><code class=\"php\">function getCategories() { $countIns=0; $url='https:\/\/pro.culture.ru\/api\/2.4\/categories?apiKey='.OurAPIKEY.'&amp;limit=100'; foreach(['places', 'events'] as $type) { $response=file_get_contents($url.\"&amp;type=$type\"); if ($response) $arrType[$type]=json_decode($response); else $arrType[$type]=NULL; } foreach($arrType as $type=>$arr) { if($arr->categories) { $arrInsert=NULL; foreach($arr->categories as $obj) { if ($obj->_id>0 &amp;&amp; in_array($obj->type, ['places', 'events'])) $arrInsert[]=['cat_id'=>$obj->_id, 'name'=>$obj->name, 'url'=>$obj->sysName, 'num'=>$obj->index, 'type'=>$obj->type ]; } if ($arrInsert) { $countIns+=Yii::$app->db->createCommand()->batchInsert('nsi_categories', ['cat_id', 'name',  'url', 'num', 'type'], $arrInsert)->execute(); } } } return $countIns; }<\/code><\/pre>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u0435\u0439 (\u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432)<\/h4>\n<pre><code class=\"php\">function getlocales() { $maxRows=1000; $countIns=0; $url='https:\/\/pro.culture.ru\/api\/2.4\/locales?apiKey='.OurAPIKEY; $response=file_get_contents($url.'&amp;limit=1'); if ($response) $arrResponse=json_decode($response); if ($arrResponse) $count=$arrResponse->total; else return 0; unset($arrResponse); for($i=0; $i&lt;ceil($count\/$maxRows); $i++) { $arrInsert=NULL; $link=$url.'&amp;offset='.($i*$maxRows).\"&amp;limit=$maxRows\"; $response=json_decode(file_get_contents($link)); foreach($response->locales as $obj) { $arrInsert[]=['ids'=>$obj->_id, 'parent_id'=>$obj->parentId, 'name'=>$obj->name, 'url'=>$obj->sysName, 'population'=>$obj->population, 'fias_id'=>$obj->fias->_id, 'fias_name'=>$obj->fias->name, 'fias_level'=>$obj->fias->level ]; } if ($arrInsert) { $countIns+=Yii::$app->db->createCommand()->batchInsert('nsi_locales', ['ids', 'parent_id', 'name', 'url', 'population', 'fias_id', 'fias_name', 'fias_level'], $arrInsert)->execute(); } } return $countIns; }<\/code><\/pre>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u043c\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0439   <\/h4>\n<pre><code class=\"php\">function getPlaces() { $arr=NULL; $maxRows=100; $model=new Places(); $countIns=0; $url='https:\/\/pro.culture.ru\/api\/2.4\/places?apiKey='.OurAPIKEY.'&amp;sort=_id&amp;status=accepted'; if (Yii::$app->request->get('date')) $date=Yii::$app->request->get('date')*1000; if ($date) $url.='&amp;startUpdateDate='.$date; $response=file_get_contents($url'.&amp;limit=1'); if ($response) $arrResponse=json_decode($response); if ($arrResponse) $count=$arrResponse->total; else return 0; unset($arrResponse); $arrCats=(new Categories())->getcategories();\/\/\u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u043c\u0435\u0441\u0442 for($i=0; $i&lt;ceil($count\/$maxRows); $i++)\/\/\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 $arr[] - \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 $maxRows=100 { $link=$url.'&amp;offset='.($i*$maxRows).\"&amp;limit=$maxRows\"; $response=json_decode(file_get_contents($link)); $arrInsert=NULL; $arrCon=NULL; foreach($response->places as $obj) {\/\/\u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430 $arr=NULL; $strGallery='';\/\/\u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044f gallery $strAddress='';\/\/\u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044f address if ($obj->gallery) { $gal=$obj->gallery; foreach($gal as $row) $arrgg[]=$row->name; $strGallery=implode(',', $arrgg); $arrgg=NULL; } if ($obj->contacts) {\/\/\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 $arrCon \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 nsi_places_contacts foreach ($obj->contacts as $key=>$val) { if ($key=='phones') foreach($val as $phones) $arrCon[]=[$obj->_id, $phones->value, $phones->comment, $key]; else $arrCon[]=[$obj->_id, $val, '', $key]; } } if ($obj->address) {\/\/\u0444\u043e\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u044f address if ($obj->address->region) $strAddress.=$obj->address->region->name .' '. $obj->address->region->type .', '; if ($obj->address->area) $strAddress.=$obj->address->area->name .' '. $obj->address->area->type .', '; if ($obj->address->city) $strAddress.=$obj->address->city->type .'. '. $obj->address->city->name .', '; if ($obj->address->settlement) $strAddress.=$obj->address->settlement->type .'. '. $obj->address->settlement->name .', '; if ($obj->address->street) $strAddress.=$obj->address->street->type .'. '. $obj->address->street->name .', '; if ($obj->address->house) $strAddress.=$obj->address->house->name; $strAddress=trim($strAddress); $strAddress=rtrim($strAddress, '!,.-'); } if ($obj->workingSchedule) {\/\/\u0430\u043d\u0430\u043b\u0438\u0437 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \"\u0427\u0427:\u041c\u041c - \u0427\u0427:\u041c\u041c\" \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043d\u044f \u043d\u0435\u0434\u0435\u043b\u0438. for ($d=0; $d&lt;7; $d++ ) { $strSched='shed_'.$d; if ($obj->workingSchedule->$d) { $from=$obj->workingSchedule->$d->from; $to=$obj->workingSchedule->$d->to; if ($from*$to>0) { $from=$from\/60000; $fh=intval($from\/60); $fm=$from-$fh*60; $to=$to\/60000; $th=intval($to\/60); $tm=$to-$th*60; $$strSched=sprintf(\"%02d:%02d - %02d:%02d\", $fh, $fm, $th, $tm); } else $$strSched=''; } } } $arrInsert[]=['ids'=>$obj->_id, 'description'=>$obj->description, 'name'=>$obj->name, 'altname'=>$obj->altName, 'img_name'=>$obj->image->name, 'img_realname'=>$obj->image->realName, 'cat_id'=>$arrCats[$obj->category->sysName], 'gallery'=>$strGallery, 'locale_id'=>$obj->locale->_id, 'mapposition'=>implode('|', $obj->mapPosition->coordinates), 'status'=>$obj->status, 'updatedate'=>$obj->updateDate\/1000, 'address'=>$strAddress, 'shed_0'=>$shed_0,  'shed_1'=>$shed_1, 'shed_2'=>$shed_2, 'shed_3'=>$shed_3, 'shed_4'=>$shed_4, 'shed_5'=>$shed_5, 'shed_6'=>$shed_6];\/\/\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c } if ($arrInsert) { $countIns+=Yii::$app->db->createCommand()->batchInsert($model->tableName(), ['ids', 'description', 'name', 'altname', 'img_name', 'img_realname', 'cat_id', 'gallery', 'locale_id', 'mapposition', 'status', 'updatedate', 'address', 'shed_0', 'shed_1', 'shed_2', 'shed_3', 'shed_4', 'shed_5', 'shed_6'], $arrInsert)->execute();\/\/\u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 } if ($arrCon) { Yii::$app->db->createCommand()->batchInsert('nsi_places_contacts', ['con_ids', 'con_value', 'con_comm', 'slug' ], $arrCon)->execute();\/\/\u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 } } return $countIns; } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043b\u0438\u0448\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u0440\u043e\u0434\u043e\u0432 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0437\u0430 8 \u043c\u0435\u0441\u044f\u0446\u0435\u0432.<\/p>\n<p>\u0412 \u0430\u0432\u0433\u0443\u0441\u0442\u0435 2020 \u0433\u043e\u0434\u0430 \u00ab\u0410\u0444\u0438\u0448\u04307\u00bb \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 PRO.\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430.\u0440\u0444 (\u043f\u043e\u0441\u0442 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0431\u043b\u043e\u0433\u0435 <a href=\"https:\/\/pro.culture.ru\/blog\/550\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<h3>\u041d\u0430\u0448\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438<\/h3>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 64 \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 500 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u043e 120 \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u0430\u043c. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u043e <a href=\"https:\/\/afisha7.ru\/uploads\/files\/instrukcia-po-rabote-s-afisa7.pdf\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0448\u043b\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043a\u0430\u043a \u043a\u0438\u043d\u043e, \u0446\u0438\u0440\u043a, \u0441\u043f\u043e\u0440\u0442, \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0430\u0442\u0440\u044b, \u043a\u043e\u043d\u0446\u0435\u0440\u0442\u044b.<\/p>\n<p>\u041d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u043e, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0430\u043b \u043e\u0431\u044f\u0437\u0430\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043e\u043d\u043b\u0430\u0439\u043d \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u0431\u0438\u043b\u0435\u0442\u043e\u0432.<\/p>\n<h3>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f API \u00abRambler-\u043a\u0430\u0441\u0441\u0430\u00bb \u0438 \u00ab\u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0430\u00bb<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u043a\u0438\u043d\u043e, \u0441\u043f\u043e\u0440\u0442, \u0442\u0435\u0430\u0442\u0440\u044b, \u043a\u043e\u043d\u0446\u0435\u0440\u0442\u044b) \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441 \u00ab\u0420\u0430\u043c\u0431\u043b\u0435\u0440-\u043a\u0430\u0441\u0441\u0430\u00bb, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438 \u00ab\u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0430\u00bb.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 API \u042f\u043d\u0434\u0435\u043a\u0441.\u0410\u0444\u0438\u0448\u0438<\/summary>\n<div class=\"spoiler__content\">\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0432\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/h4>\n<pre><code class=\"php\">function getYandexJson($ticket) {$res=NULL; $path=BASE_PATH . '\/json\/ya\/'; $fn='new.gz'; $ffn=$path.$fn; $url='https:\/\/afisha.yandex.ru\/export\/json'; $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Token '.OurAPIKEY]); curl_setopt($curl, CURLOPT_URL, $url); $out = curl_exec($curl); curl_close($curl); $json=json_decode($out); if ($json[0]->url) { $ReadFile = fopen ($json[0]->url, \"rb\"); if ($ReadFile) { $WriteFile = fopen ($ffn, \"wb\"); if ($WriteFile) { while(!feof($ReadFile)) { fwrite($WriteFile, fread($ReadFile, 4096 )); } fclose($WriteFile); } fclose($ReadFile); } if (file_exists($ffn)) { $command='tar xzvpf '.$ffn.' -C '.$path; $res=shell_exec($command); } } return $res; }<\/code><\/pre>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0441\u0442<\/h4>\n<pre><code class=\"php\">function getPlacesYa($cityid=0) { $path=BASE_PATH . '\/json\/ya\/'; $countInsert=0; $errors=NULL; $success=NULL; $filename='venues.json'; $arrCities=Nsicities()::getCities(); $arrPlaces=Nsiplaces::getPlaces(); $cities=scandir($path); foreach($cities as $townid) { $arrInsert=NULL; if (in_array($townid, $arrCities) &amp;&amp; file_exists($path.$townid.'\/'.$filename)) { $json=file_get_contents($path.$townid.'\/'.$filename); $arr=json_decode($json); foreach($arr as $obj) { $arrPhones=NULL; $strPhones='';<\/code><\/pre>\n<\/div>\n<\/details>\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-327948","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327948","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=327948"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327948\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}