Customized ShareThis Button using jQuery and the ShareThis API

Using ShareThis and want to have a customized version of multiple share buttons on one page?  The ShareThis API developer docs section would have you include a hefty piece of JavaScript wherever you wanted the ShareThis object to occur.  That is not only messy, but not very practical.  I was shocked I couldn't find anyone that had posted a jQuery tidbit to fix this.  I found one attempt posted in their forums, but no final solution.  The solution below is based on the previous finding and this forum thread.

Be sure to read the developer docs and include the correct ShareThis widget JS file with your publisher Id prior to this code [ something like http://w.sharethis.com/widget/?tabs=web%2Cpost%2Cemail&charset=utf-8&style=default&publisher=(pub-id) ]

What I've done is loop through any cases where the sharethis class is present.  Inside the link include all the necessary information in data-* attributes that we pull out using jQuery.

    <script type="text/javascript">
        $(document).ready(function () {
          SHARETHIS.onReady();
          $("a.sharethis").each(function (index) {
            var id = $(this).attr('data-id');
            var purl = '[http://mydomain.com/posts/']               (http://mydomain.com/posts/) + id
            var ptitle = $(this).attr('data-title');
            var thisobj = SHARETHIS.addEntry({ title: ptitle, url: purl }, { button: false });
            thisobj.attachButton(document.getElementById("sharethis-" + id));
          });
        });
</script>  

Example customized ShareThis Link

<a class="sharethis" data-id="(uniqueid)" data-title="The Title of This Post" id="sharethis-(uniqueid)">Share</a>