Skip to content

Instantly share code, notes, and snippets.

@EclipseGc
Created August 7, 2014 16:54
Show Gist options
  • Save EclipseGc/a23c888edf29ac191013 to your computer and use it in GitHub Desktop.
Save EclipseGc/a23c888edf29ac191013 to your computer and use it in GitHub Desktop.
<?php
$migrate = new Migrator();
$migrate->disabled = FALSE; /* Edit this to true to make a default migrate disabled initially */
$migrate->api_version = 1;
$migrate->machine_name = 'drupal_org_planet_feed';
$migrate->admin_title = 'Drupal.org Planet Feed';
$migrate->source = 'xml';
$migrate->destination = 'node';
$migrate->configuration = array(
'url' => 'https://www.drupal.org/planet/rss.xml',
'item_xpath' => '/rss/channel/item',
'item_id_xpath' => 'link',
'node_type' => 'article',
);
$migrate->mapping = array(
'title' => array(
'value' => 'title',
),
'body' => array(
'value' => 'description',
),
'body:format' => array(
'default' => 'filtered_html',
),
'status' => array(
'default' => '0',
),
'created' => array(
'value' => 'pubDate',
),
'changed' => array(
'value' => 'pubDate',
),
);
$migrate->processors = array(
'title' => array(
0 => array(
'id' => 'appendstr',
'configuration' => array(
'string' => 'Drupal Planet: ',
'position' => 'before',
),
),
),
'created' => array(
0 => array(
'id' => 'strtotime',
'configuration' => array(),
),
),
'changed' => array(
0 => array(
'id' => 'strtotime',
'configuration' => array(),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment