An excerpt from http://www.sitepoint.com/create-a-most-shared-posts-plugin-for-wordpress/ , by @narayanprusty
Displaying a list of posts in a blog with the most number of shares is a good way to improve a site’s user navigation. In the case of WordPress, a widget is the ideal place for this. Users who wouldn’t
otherwise know where to go after reading the current post might check out and hopefully participate in your blog’s most shared posts. These are commonly also the ones which have the most page views, and are likely to be of interest to more readers.
In this tutorial we’ll create a basic plugin to display the most shared posts in a widget. Although there are lots of plugins available for this purpose, many of them tend to be overwhelming and also don’t
support caching. In this article, the plugin we’ll build will be lightweight and will cache the top ten most shared posts for the past six hours.