and the moral of the story is: search before posting a question.
Just to finish the above code (with a fall-back image):
<?php
if ($imageurl = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail'))
echo '<meta property="og:image" content="'.$imageurl[0].'"/> ';
else
echo '<meta property="og:image" content="http://domain.com/dummy.jpg"/> ';
?>
or if using the code from the other post (many ways of doing things):
<?php
if (!($imageurl = wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ))))
$imageurl = 'http://domain.com/dummy.jpg';
echo '<meta property="og:image" content="'.$imageurl.'"/> ';
?>
or like this:
<?php
if (!($imageurl = wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ))))
$imageurl = 'http://domain.com/dummy.jpg'; ?>
<meta property="og:image" content="<?php echo $imageurl; ?>"/>
or to include the video preview images too (and all the other methods to add default images):
<?php
$image = get_image('noresize', true);
preg_match('/src=\"([^\"]*)\"/i', $image, $iurl);
if (!($imageurl = $iurl[1])) $imageurl = 'http://domain.com/dummy.jpg'; ?>
<meta property="og:image" content="<?php echo $imageurl; ?>"/>