Posted By

dottDesign on 04/29/10


Tagged

textmate html twitter


Versions (?)

Post to Twitter


 / Published in: Other
 

  1. <script type="text/javascript">// <![CDATA[
  2. var twtTitle = document.title;
  3. var twtUrl = location.href;
  4. var maxLength = 140 - (twtUrl.length + 1);
  5. if (twtTitle.length > maxLength) {
  6. twtTitle = twtTitle.substr(0, (maxLength - 3))+'...';
  7. }
  8. var twtLink = 'http://twitter.com/home?status=Check This Out: '+encodeURIComponent(twtTitle + ' ' + twtUrl);
  9. document.write('<a href="'+twtLink+'" target="_blank"'+'><img src="http://www.website.com/path/tweet_this.jpg" border="0" alt="Tweet This!" /'+'><'+'/a>');
  10. // ]]></script>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: online on September 16, 2010

Depricated...OAuth required...

You need to login to post a comment.