I’m using the next code to handle the first time post publish event.
WordPress 3.0+ required.
add_action( 'publish_post', 'run_when_post_published_first_time',10,2 );
function run_when_post_published_first_time($post_id, $post)
{
// Checks whether is post updated or published at first time.
if ($post->post_date != $post->post_modified) return;
// Place here your code
}
P.S. Sorry for my english.