I needed to get some xml data and generate nodes out of them. This shows how I created nodes programmatically from my module in Drupal 7. I also suggest looking into creating a node using entity metadata wrapper.
Source code viewer
// Get current user for id. global $user; // Make new object for an object. $node = new stdClass(); // Title for the node. $node->title = 'title for node'; // Node type - page exists in default. $node->type = 'page'; // User id - who owns/created the node $node->uid = $user->uid; // Set the language of the node to neutral. $node->language = LANGUAGE_NONE; // Node body - default field. $node->body[LANGUAGE_NONE][0]['value'] = 'node body'; // Custom field - made by fields/cck. $node->field_in_store[LANGUAGE_NONE][0]['value'] = ''; // Taxonomy term number. $node->field_category[LANGUAGE_NONE][0]['tid'] = 1; // Save / create the node. node_save($node);Programming Language: PHP