Tagging stuff in WordPress requires several steps and quite a lot of code.
Tagliatelle is a PHP-class for rapid development and easy tagging in WordPress plugins and themes. Make one single call to tag a post (or custom post type with a term). If the referenced term doesn’t already exist it is created automagicly. It is even possible to tag several terms to an object with one call.
Load the plugin and use the class for easy tagging.
// Create a Tagliatelle object
$hottie = new Tagliatelle;
// Use it to tag the current post with the tag 'kers'
// If you want to, you can pass a comma separated list with tags.
$hottie->write_tags($post->ID,'tag1, tag2, tag3');
// It it of course possible to use / create tags in any taxonomy:
$hottie->write_tags($post->ID,'green, blue, red','supercolortaxonmy');
The current development version can be found at GitHub: https://github.com/bolstad/wp-tagliatelle