Posted By

weitzman on 08/16/06


Tagged

textmate script drupal


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

panatlantica
kellyharding
DanS42
troynt


programmtically submit a node


 / Published in: PHP
 

  1. <?php
  2.  
  3. require 'includes/bootstrap.inc';
  4. drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  5.  
  6. global $mypost, $form_post_key;
  7. $mypost['edit']['title'] = 'robo-post: '. format_date(time(), 'small');
  8. $mypost['edit']['type'] = 'story'; // not needed?
  9. $mypost['edit']['body'] = 'viva druplicon';
  10. $form_post_key = 'mypost';
  11. $output = drupal_get_form('story_node_form', array()); // that final array() should be optional
  12.  
  13. print theme('page', $output);

Report this snippet  

You need to login to post a comment.