Wednesday, August 27, 2014

Drupal feeds batch import - Feeds batch process

Feeds module is a one of the best module to import nodes from external URL, xls file or from  xml file, etc..

After creating feeds import for particular action, we can run it via batch process. Like via cron instead of running it manually.

I will create new post to create about feeds import.

Below line of codes worked perfect for one of  my project:

$file = 'your-xml-file.xml';
$my_importer = feeds_source('your_importer_name');
$config = array('FeedsFileFetcher'=>array('source'=>'sites/default/files/' . $file));
$my_importer->addConfig($config);
while (FEEDS_BATCH_COMPLETE != $my_importer->import());

use below link to integrate above batch process via cron.

http://kali-dasan.blogspot.in/2014/08/drush-custom-command-drush-in-our.html

No comments:

Post a Comment