Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save landsurveyorsunited/d9d5bcec1a99306e544c to your computer and use it in GitHub Desktop.
Save landsurveyorsunited/d9d5bcec1a99306e544c to your computer and use it in GitHub Desktop.
D7 Feeds JSON JSONPath parser ning users importer example
$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 = 'ning_users';
$feeds_importer->config = array(
'name' => 'Ning Users',
'description' => 'port over ning users',
'fetcher' => array(
'plugin_key' => 'FeedsFileFetcher',
'config' => array(
'allowed_extensions' => 'txt csv tsv xml opml json',
'direct' => 0,
'directory' => 'public://feeds',
'allowed_schemes' => array(
'public' => 'public',
),
),
),
'parser' => array(
'plugin_key' => 'FeedsExJsonPath',
'config' => array(
'context' => array(
'value' => '$.[]',
),
'sources' => array(
'name' => array(
'name' => 'name',
'value' => 'fullName',
'debug' => 1,
'weight' => '1',
),
'mail' => array(
'name' => 'mail',
'value' => 'email',
'debug' => 1,
'weight' => '2',
),
'created' => array(
'name' => 'created',
'value' => 'createdDate',
'debug' => 1,
'weight' => '3',
),
'ning_uid' => array(
'name' => 'ning uid',
'value' => 'contributorName',
'debug' => 0,
'weight' => '4',
),
),
'display_errors' => 1,
'debug_mode' => 1,
'source_encoding' => array(
0 => 'auto',
),
),
),
'processor' => array(
'plugin_key' => 'FeedsUserProcessor',
'config' => array(
'roles' => array(
4 => '4',
3 => 0,
6 => 0,
),
'status' => '1',
'defuse_mail' => 1,
'mappings' => array(
0 => array(
'source' => 'created',
'target' => 'created',
'unique' => FALSE,
),
1 => array(
'source' => 'mail',
'target' => 'mail',
'unique' => FALSE,
),
2 => array(
'source' => 'name',
'target' => 'field_first_last_name',
'unique' => FALSE,
),
3 => array(
'source' => 'ning_uid',
'target' => 'name',
'unique' => FALSE,
),
),
'update_existing' => '2',
'input_format' => 'plain_text',
'skip_hash_check' => 0,
'bundle' => 'user',
),
),
'content_type' => '',
'update' => 0,
'import_period' => '-1',
'expire_period' => 3600,
'import_on_create' => 1,
'process_in_background' => 0,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment