Announcing Kindle Sharing Support

Amazon Kindle LogoWe’re happy to announce the addition of Send to Kindle support to our Sharing toolbox – now, VIP customers can offer site visitors a Send to Kindle sharing option on site content. The popularity and convenience of Amazon Kindle provides a great fit for consuming WordPress content – users can send any article to their Kindle device(s) for later consumption, both on and offline, at their convenience!

To add Kindle support, simply drag the Kindle button to the enabled Sharing services under Settings -> Sharing; it’s really that simple!

If your theme is using non-standard class names for content wrappers, you’ll need to tell Kindle how to find your content via the jetpack_sharing_kindle_selectors filter. This filter accepts an array of CSS selectors and the post’s ID and should return an array of CSS selectors for Kindle to use to scrape the content:

add_filter( 'jetpack_sharing_kindle_selectors', 'my_kindle_sharing_selectors_filter', 10, 2 );

function my_kindle_sharing_selectors_filter( $selectors, $post_id ) {
    $selectors['title']     = '.my-entry-title'; // The content's title
    $selectors['published'] = '.my-entry-date'; // The content's published date
    $selectors['content']   = '.my-post'; // The content body
    $selectors['exclude']   = '.sharedaddy, .my-excludes'; // CSS selectors to exclude from inside the content

    return $selectors;
}

Customizing the Sharing Experience

Two features we wanted to highlight that are available to VIPs to improve the sharing experience for your users.

Open Graph

About a month ago, we enabled Open Graph Tags for all public blogs on WordPress.com. Open Graph tags make it easier for you to control what information Facebook, Google+, and other services display when users share posts from your site. We excluded VIP sites as many of you already have custom code that handles these tags.

If you don’t already have Open Graph implemented on your site or want to trim some code from your theme(s), you can add the following helper function to your functions.php and the tags will be auto-generated for you.

wpcom_vip_enable_opengraph();

If you’d like a closer look at the code that generates the tags, you can find it here: https://gist.github.com/1196068. (We made sure to sprinkle some extra BBQ sauce for handling Gallery images and Author pages!)

If you’d like to fine-tune the output of the tags, you can filter jetpack_open_graph_tags and modify the array that’s passed in.

Here’s what this post looks like (with Open Graph enabled) when sharing on Facebook and Google+:

Twitter /via

Customize your Twitter /via

If you’re using the built-in WordPress.com Sharing buttons, we’ve added a helper function to customize the “/via” tag appended to Tweets. Just add the following to your functions.php and change the argument to the username you want attributed.

wpcom_vip_sharing_twitter_via( 'automattic' );

If you want to disable the “/via”, just pass in false

wpcom_vip_sharing_twitter_via( false );

If you need help implementing either of these, please get in touch.

Have you taken our VIP Services Customer Satisfaction Survey yet? We’d love your input.