<br><br><div class="gmail_quote">On Thu, Feb 5, 2009 at 3:37 PM, M. Fioretti <span dir="ltr">&lt;<a href="mailto:mfioretti@nexaima.net">mfioretti@nexaima.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thu, Feb 05, 2009 13:50:46 PM -0500, Earl Dunovant wrote:<br>
&gt; Use drupal_execute().<br>
&gt;<br>
&gt; <a href="http://api.drupal.org/api/function/drupal_execute/6" target="_blank">http://api.drupal.org/api/function/drupal_execute/6</a><br>
<br>
</div>
<br>
The only problem is that to write such a script one needs to know in<br>
advance:<br>
<br>
- the exact sequence of URLs to call (isn&#39;t this documented anywhere<br>
 &nbsp;but in the source code itself?)<br>
- a list of the names and admissible values of all the form variables<br>
 &nbsp;to pass to curl when it calls each one of those URLs. (**)<br>
<br>
</blockquote></div>You need to know the fields in the form to create the node type you want to create. You put the data in $form_state[&#39;values&#39;], just as is passed into, hook_form_alter(). You can get that by writing a hook_form_alter() function that calls var_export($form_state[&#39;values&#39;], 1);<br>
<br>Then, <br>1: call drupal_get+form() to get the from-defining array<br>2: populate your $form_state[&#39;values&#39;} array with your new node data <br>3: call drupal_execute($form_id, $form, $form_state);<br><br>Lather, rinse, repeat until you&#39;re done. No URLs involved. Stick it in a module and call it from your script or a menu as you prefer.<br>
<br>Read the docs and you&#39;ll see how it&#39;s done. <br>