ovizii
7/28/2013 - 8:32 AM

Create a snapshot of any website

Create a snapshot of any website

function wp_snap($atts, $content = NULL) {

extract(shortcode_atts(array(
"snap" => ‘http://s.wordpress.com/mshots/v1/’,
"url" => ‘http://torquemag.io/’,
"alt" => ‘WPDaily’,
"w" => ’400′, // width
"h" => ’300′ // height
), $atts));
$img = ‘<img alt="’ . $alt . ‘" src="’ . $snap . ” . urlencode($url) . ‘?w=’ . $w . ‘&h=’ . $h . ‘" />’;
return $img;
}

add_shortcode("snap", "wp_snap");

//To use this shortcode just add the following to your post.
//[code][snap url="http://torquemag.io/" alt="WPDaily Website" w="400" h="300"]