Вопрос по feeds_import

Главные вкладки

Аватар пользователя soko1 soko1 9 апреля 2012 в 15:46

Добрый день.
Переписал файл feeds_import.feeds_importer_default.inc непосредственно в самом модуле 'feeds/feeds_import/', если так неправильно делать - поправьте пожалуйста. Нигде не нашёл инфы о том, куда это всё дело пихать.

А вопрос таков. Как сделать, чтобы на странице 'http://localhost/core/import/mytest' URL вставлялось ИЗ СКРИПТА? Дело в том, что урл у меня динамический и руками его вбивать неправильно. Честно говоря всё перерыл так и не нашёл где это делается. Буду очень благодарен за помощь.

Код:

<?php
/**
 * file
 * feeds_import.feeds_importer_default.inc
 */

/**
 * Implementation of hook_feeds_importer_default().
 */

function feeds_import_feeds_importer_default() {
 $export = array();

$feeds_importer = new stdClass();
$feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer->api_version = 1;
$feeds_importer->id = 'test';
$feeds_importer->config = array(
  'name' => 'test',
  'description' => '',
  'fetcher' => array(
    'plugin_key' => 'FeedsHTTPFetcher',
    'config' => array(
      'auto_detect_feeds' => FALSE,
      'use_pubsubhubbub' => FALSE,
      'designated_hub' => '',
    ),
  ),
  'parser' => array(
    'plugin_key' => 'FeedsXPathParserXML',
    'config' => array(
      'sources' => array(
        'xpathparser:0' => 'contentSet/inlineXML/*',
        'xpathparser:1' => 'itemMeta/title',
        ),
      'rawXML' => array(
        'xpathparser:0' => 1,
        ),
      'context' => '//newsItem',
      'exp' => array(
        'errors' => FALSE,
        'tidy' => FALSE,
        'debug' => array(),
        'tidy_encoding' => 'UTF8',
      ),
      'allow_override' => TRUE,
    ),
  ),
  'processor' => array(
    'plugin_key' => 'FeedsNodeProcessor',
    'config' => array(
      'content_type' => 'article',
      'update_existing' => '1',
      'expire' => '-1',
      'mappings' => array(
        0 => array(
          'source' => 'xpathparser:0',
          'target' => 'body',
          'unique' => FALSE,
        ),
        1 => array(
          'source' => 'xpathparser:1',
          'target' => 'title',
          'unique' => 0,
        ),
      ),
      'input_format' => 'full_html',
      'author' => 0,
    ),
  ),
  'content_type' => '',
  'update' => 0,
  'import_period' => '-1',
  'expire_period' => 3,
  'import_on_create' => 1,
  'process_in_background' => 0,
);
  $export['ibtimes'] = $feeds_importer;
  return $export;

}

Комментарии

Аватар пользователя soko1 soko1 9 апреля 2012 в 19:38

Ещё более интересный вопрос - КУДА этот код писать? Можно ли его написать куда-то кроме базы данных (таблица feeds_importer)?