Twitter Cards

Twitter recently launched their Twitter Cards functionality:

Twitter cards make it possible for you to attach media experiences to Tweets that link to your content. Simply add a few lines of HTML to your webpages, and users who Tweet links to your content will have a “card” added to the Tweet that’s visible to all of their followers.

If you’re using our Open Graph Tags, your sites are already optimized for Twitter Cards. We add some additional Twitter-specific metadata to the <head> section of your site, including user information if you’re using Publicize to automatically publish your Tweets.

To customize the output of the tags you can use the jetpack_open_graph_tags filter:

add_filter( 'jetpack_open_graph_tags', 'my_add_twitter_card_extras' );

function my_add_twitter_card_extras( $tags ) {
	// set @username of website
	$tags[ 'twitter:site' ] = 'automattic';
	return $tags;
}

Update (2012-07-05 5:45pm ET): Twitter is still whitelisting partners so you need to apply for Twitter cards to work with your site. If you’re using wp.me shortlinks, they should work as-is.