I would like to try the following (in a php script) which is based off of many, many posts and especially this and this. My current issue is that '_content_widget_invoke()' seems to no longer exist. Here is what I am working with:

require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$node = node_load($nid);
_content_widget_invoke('prepare form values', $node);
$form_state = array(); 
module_load_include('inc', 'node', 'node.pages'); 
$node = array('type' => 'user_profile'); 
$form_state['values']['title'] = 'My node'; 
$form_state['values']['body'] = 'This is the body text!'; 
$form_state['values']['op'] = t('Save');
drupal_execute('user_profile_node_form', $form_state, (object)$node);

From my understanding the '_content_widget_invoke()' is being used to load the values to the form before they are modified and ultimately submitted. Is there a way to make this work? i.e. load a node, update it, and then save it with drupal_execute()? Or should I be taking a different approach?