All the code you need can be found in
You will need to load the product by it's ID and load the wish list by customer. The code would look roughly something like this.
$wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($customerId, true);
$product = Mage::getModel('catalog/product')->load($productId);
$buyRequest = new Varien_Object(array()); // any possible options that are configurable and you want to save with the product
$result = $wishlist->addNewItem($product, $buyRequest);
Just out of curiosity. Why not use the
addAction provided by the wishlist controller to add the products?
You can obtain the url via