The issue here is the LinkedIn post functionality is tied to the node form; the form is altered to add the form component & submission hook. However, Feeds isn't using this form so it will never get a chance to process the submission handler.
If you look at the submission handler you can pull out the relevant function, linkedin_put_profile_field()
, to make this happen. Combine this with hook_feeds_after_import(), and you can come up with an implementation that will trigger a LinkedIn post upon a feed import:
function MYMODULE_feeds_after_import(FeedsSource $source) {
if(function_exists('linkedin_put_profile_field') && isset($source->feed_nid) && $node = node_load($source->feed_nid) {
$status = variable_get('linkedin_default_format_'. $node->type, '');
linkedin_put_profile_field($node->uid, 'current-status', $status);
}
}
Note: there will probably need to be more checks & altercations here based on your needs (e.g. setting the right UID to post as, throttling posting so your feed importing doesn't get marked as spam on LinkedIn).