$basic_post_args = array(
'post_title' => 'My Basic Post',
'post_content' => 'This is a basic content',
'post_status' => 'publish',
'post_author' => 1,
'post_category' => array(8, 59)
);
wp_insert_post( $basic_post_args );