Correct way to add a tweet button?
Do not place the &lt;script&gt; tag in node.tpl.php because it will repeat if multiple nodes are arranged to appear in a single page.

Use following code to add js in page and call this function in hook_init() or in your page's callback function.

drupal_add_js('&lt;script&gt;...&lt;/script&gt;',array(
  'type' =&gt; 'inline', 
  'scope' =&gt; 'footer'
));