Ubuntu / Linux news and application reviews.

A lot of blogs use a "Post to Twitter" button/icon which either sets your twitter status directly, but without shortening the url, like so: click me, or by using TwitThis: click me.

Why these 2 ways to post the blogpost you are currently reading are no good? Firstly, you have to leave the current page. Secondly, by using the first one, the url will not be shortened and if the title is too long, you cannot post it directly so that's a big disadvantage.

But how about using BigTweet?

bigtweet

Try it: click me. That is a really nice way to add a "Tweet this post" button to your blog's posts.

To use BigTweet into your blog template, simply add any Twitter icon or "Tweet this post" text or anything like it, and instead of a normal link, add this:
<a href="javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('src','http://bigtweet.com/ext/bigt/bigt.js');document.body.appendChild(e)})())">Your Text / Image Here</a>


For blogger blogs, the text needs a bit of encoding so you won't get errors. Because I cannot encode it twice to post it here, I will give you an url where you will find the text exactly the way you need to insert it into your blogspot.com template, here.

Update: or, if you want to be redirected to Twitter and still have the url shortened, you can use a direct link from Addtoany:
http://www.addtoany.com/add_to/twitter?linkurl=YOUR_URL&linkname=POST_TITLE&linknote=POST_TITLE


Obviously, replace YOUR_URL and POST_TITLE (in both places) with the appropriate parameters for your blog. For Blogger blogs, this would look like this.