Module Dev: How to attach a button to a field?
This example comes close: Publishing to Facebook Wall. It shows how to post a facebook message when a node or comment form is submitted, and provide an option to opt-out on the node or comment form.