{"id":164707,"date":"2013-01-04T14:49:03","date_gmt":"2013-01-04T10:49:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=164707"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=164707","title":{"rendered":"<span class=\"post_title\">Drupal: \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u043f\u0430\u0440\u0441\u0435\u0440 \u0434\u043b\u044f Feeds<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"http:\/\/drupal.org\/project\/feeds\">Feeds<\/a> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u0438 Drupal-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f Feeds. <br \/>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 3 \u0432\u0438\u0434\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435:  <\/p>\n<ul>\n<li>FeedsFetcher \u2014 \u043f\u043b\u0430\u0433\u0438\u043d \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430. C\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435: HTTP \u0438 File Upload. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li>FeedsProcessor \u2014 \u043f\u043b\u0430\u0433\u0438\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. C\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435: Node processor, Taxonomy term processor, User processor. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043d\u0435 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440.<\/li>\n<li>FeedsParser \u2014 \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u0430\u0440\u0441\u0435\u0440\u0430. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u0430\u0440\u0441\u0435\u0440\u044b \u0432 Feeds \u044d\u0442\u043e XML, CSV \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435.<\/li>\n<\/ul>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0430\u0440\u0441\u0435\u0440\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f<\/h5>\n<p>  \u041a\u0430\u043a \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c info \u0444\u0430\u0439\u043b \u0438 \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0443\u043b\u044f:<\/p>\n<p>  json_example_parser.info  <\/p>\n<pre><code class=\"apache\">name = Json example parser description = Simple json parser package = Feeds core = 7.x dependencies[] = feeds <\/code><\/pre>\n<p>  json_example_parser.module  <\/p>\n<pre><code class=\"php\">&lt;?php \/**  * @file  * Json example parser - simple parser plugin  *\/  \/**  * Implementation of hook_feeds_plugins().  * \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.  *\/ function json_example_parser_feeds_plugins() {   $info = array();   $info['JsonExampleParser'] = array(     'name' =&gt; 'JSON parser',     'description' =&gt; 'Parses custom JSON.',     'handler' =&gt; array(       'parent' =&gt; 'FeedsParser', \/\/ \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043f\u0430\u0440\u0441\u0435\u0440, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b Feeds - FeedsFetcher, FeedsParser \u0438 FeedsProcessor       'class' =&gt; 'JsonExampleParser', \/\/ \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0441\u0435\u0440\u0430, \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043a\u043b\u044e\u0447\u043e\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435       'file' =&gt; 'JsonExampleParser.inc', \/\/ \u0444\u0430\u0439\u043b \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0430\u0440\u0441\u0435\u0440\u0430       'path' =&gt; drupal_get_path('module', 'json_example_parser'), \/\/ \u043f\u0443\u0442\u044c \u043a \u043a\u043b\u0430\u0441\u0441\u0443 \u043f\u0430\u0440\u0441\u0435\u0440\u0430     ),   );   return $info; }  \/\/ \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u043a\u0435\u0448\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 Feeds \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f function json_example_parser_enable() {   \/\/clear the cache to display in Feeds as available plugin.   cache_clear_all('plugins:feeds:plugins', 'cache'); } ?&gt; <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0445\u0443\u043a\u043e\u0432.<\/p>\n<h5>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h5>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0437\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043d\u043e\u0434\u0443 \u201c\u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u0430\u044f \u0438\u0433\u0440\u0430\u201d \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/7e6\/c30\/67e\/7e6c3067e3784e74c951838f08953380.png\"\/><br \/>  \u0414\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0430\u0440\u0441\u0438\u0442\u044c, \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u0432 JSON \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u041d\u0435 \u0432\u0430\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u044d\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043b\u0438\u0431\u043e HTTP \u0441\u0431\u043e\u0440\u0449\u0438\u043a, \u0437\u0430 \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 Fetcher \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430.<\/p>\n<p>  \u0412\u0445\u043e\u0434\u043d\u043e\u0439 JSON:<\/p>\n<pre><code class=\"apache\">[   { &quot;name&quot;:&quot;Team Fortress 2&quot;,     &quot;year&quot;:2007,     &quot;price&quot;:0   },   { &quot;name&quot;:&quot;Warcraft III: The Frozen Throne&quot;,     &quot;year&quot;:2003,     &quot;price&quot;:13.9   },   { &quot;name&quot;:&quot;Diablo III&quot;,     &quot;year&quot;:2012,     &quot;price&quot;:33   } ] <\/code><\/pre>\n<h5>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0430\u0440\u0441\u0435\u0440\u0430<\/h5>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043f\u0430\u0440\u0441\u0435\u0440\u0430 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 FeedsParser \u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b parse \u0438 getMappingSources. \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p>  JsonExampleParser.inc  <\/p>\n<pre><code class=\"php\">&lt;?php \/**  * A JSON example parser  *\/ class JsonExampleParser extends FeedsParser {   \/**    * Implements FeedsParser::parse().    *\/   public function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result) {     $result = new FeedsParserResult();     \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438     $source_config = $source-&gt;getConfigFor($this);     \/\/ \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c JSON \u0434\u0430\u043d\u043d\u044b\u0435     $fetch_items = json_decode($fetcher_result-&gt;getRaw());     foreach ($fetch_items as $value) {       $item = array('name' =&gt; $value-&gt;name);       if ($value-&gt;year) {         $item['year'] = intval($value-&gt;year);       }       if ($value-&gt;price) {         $item['price'] = floatval($value-&gt;price);       }       \/\/ \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0438\u0437 \u0444\u043e\u0440\u043c\u044b       if (  $source_config['type'] == 'all' ||             ($source_config['type'] == 'free' && $item['price'] == 0) ||             ($source_config['type'] == 'paid' && $item['price'] &gt; 0)) {         \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430         $result-&gt;items[] = $item;       }     }     return $result;   }    \/**    * Implements FeedsParser::getMappingSources().    *\/   public function getMappingSources() {     return array(       'name' =&gt; array(         'name' =&gt; t('Game name'),         'description' =&gt; t('The name of the computer game.'),       ),       'year' =&gt; array(         'name' =&gt; t('Release year'),         'description' =&gt; t('Release year of the computer game.'),       ),       'price' =&gt; array(         'name' =&gt; t('Game price'),         'description' =&gt; t('The cost of the computer game.'),       ),     ) + parent::getMappingSources();   }    \/**    * Configuration form.    * \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435\u0440\u0430.    *\/   public function configForm(&$form_state) {     $form = array();     $form['type'] = array(       '#type' =&gt; 'select',       '#title' =&gt; t('Game type'),       '#description' =&gt; t('Game filter by type.'),       '#options' =&gt; array(         'all' =&gt; t('All game'),         'paid' =&gt; t('Paid'),         'free' =&gt; t('Free'),       ),       '#default_value' =&gt; $this-&gt;config['type'],     );     return $form;   }    \/**    * Define default configuration values.    * \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u0435\u0441\u043b\u0438 \u0444\u043e\u0440\u043c\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0430 \u0432\u043f\u0435\u0440\u0432\u044b\u0435.    *\/   public function configDefaults() {     return array(       'type' =&gt; 'all',     );   }    \/**    * Define defaults.    * \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 \u0444\u043e\u0440\u043c\u044b.    *\/   public function sourceDefaults() {     return array(       'type' =&gt; $this-&gt;config['type'],     );   }    \/**    * Show configuration form for users.    * \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0430.    *\/   public function sourceForm($source_config) {     $form = array();     $form['#weight'] = -10;     $form['help']['#markup'] = '&lt;div class=&quot;help&quot;&gt;&lt;p&gt;' . t('Select the type of game you want to import') . ':&lt;\/p&gt;&lt;\/div&gt;';     $form['type'] = array(       '#type' =&gt; 'select',       '#title' =&gt; t('Game type'),       '#description' =&gt; t('Game filter by type.'),       '#options' =&gt; array(         'all' =&gt; t('All game'),         'paid' =&gt; t('Paid'),         'free' =&gt; t('Free'),       ),       '#default_value' =&gt; isset($source_config['type']) ? $source_config['type'] : 'all',     );     return $form;   } } <\/code><\/pre>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u043c\u0435\u0442\u043e\u0434\u0430\u0445.<\/p>\n<p>  parse \u2014 \u043c\u0435\u0442\u043e\u0434 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 FeedsSource \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 FeedsFetcherResult \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 FeedsParserResult \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 items \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  getMappingSources \u2014 \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043f\u043e\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043b\u0435 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 name \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043d\u043e\u0434\u044b \u0438 \u0442.\u0434.<\/p>\n<p>  configForm \u2014 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0438\u043c\u043f\u043e\u0440\u0442\u0435\u0440\u0430. \u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  configDefaults \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u0441\u0435\u0440\u0430.<\/p>\n<p>  sourceDefaults \u2014 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0438\u0437 \u0444\u043e\u0440\u043c\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  sourceForm \u2014 \u0444\u043e\u0440\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435, \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044f \u0444\u043e\u0440\u043c\u0443 Fetcher\u2019a.<\/p>\n<h5>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044f Feeds \u0441 \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043b\u044e\u0431\u044b\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u0445 Feeds \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0443\u0442 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/164707\/\"> http:\/\/habrahabr.ru\/post\/164707\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"http:\/\/drupal.org\/project\/feeds\">Feeds<\/a> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u0438 Drupal-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f Feeds. <br \/>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 3 \u0432\u0438\u0434\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435:  <\/p>\n<ul>\n<li>FeedsFetcher \u2014 \u043f\u043b\u0430\u0433\u0438\u043d \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430. C\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435: HTTP \u0438 File Upload. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li>FeedsProcessor \u2014 \u043f\u043b\u0430\u0433\u0438\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. C\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435: Node processor, Taxonomy term processor, User processor. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043d\u0435 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440.<\/li>\n<li>FeedsParser \u2014 \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u0430\u0440\u0441\u0435\u0440\u0430. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u0430\u0440\u0441\u0435\u0440\u044b \u0432 Feeds \u044d\u0442\u043e XML, CSV \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435.<\/li>\n<\/ul>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0430\u0440\u0441\u0435\u0440\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-164707","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/164707","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=164707"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/164707\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=164707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=164707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=164707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}