I'm looking for a way to call the magento export (System->Import/Export->Export) product export from an URL for a 3rd party system. So I want something like https://my.domain.com/bla/blub/export.php?filterAttribute=2 and that shall return a csv of all products with filterAttribute 2. I managed to do this by using dataflow export and then readfile() to the client, just to realize that this is missing lots of attributes.
So, currently I basically do something like:
$profile = Mage::getModel("dataflow/profile")->load($profileId);
$adminUser = Mage::getModel('admin/user')->setUserId(0);
Mage::getSingleton('admin/session')->setUser($adminUser);
$profile->load($profileId);
$guiData = $profile->getGuiData();
$guiData['product']['filter']['filterAttribute'] = 2;
$profile->setGuiData($guiData);
$profile->save();
$profile = Mage::getModel("dataflow/profile")->load($profileId);
Mage::register('current_convert_profile', $profile);
$profile->run();
readfile($exportFile);
Now, how do I transfer this simple code to Import/Export? Magento 1.9