<br><br><div class="gmail_quote">On Thu, Feb 5, 2009 at 3:37 PM, M. Fioretti <span dir="ltr"><<a href="mailto:mfioretti@nexaima.net">mfioretti@nexaima.net</a>></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>
> Use drupal_execute().<br>
><br>
> <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't this documented anywhere<br>
but in the source code itself?)<br>
- a list of the names and admissible values of all the form variables<br>
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['values'], 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['values'], 1);<br>
<br>Then, <br>1: call drupal_get+form() to get the from-defining array<br>2: populate your $form_state['values'} array with your new node data <br>3: call drupal_execute($form_id, $form, $form_state);<br><br>Lather, rinse, repeat until you'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'll see how it's done. <br>