Looking for top stories ? Technology » Business » Politics » Entertainment » Sports » Web Design » Money Making Tips » SEO » Travel » Science
Twitter | FF | del.icio.us | Feeling Lucky? | View blog reactions |

Sunday, February 08, 2009

Add “TweetThis” Button To Your Blog

As you know, twitter is growing very rapidly and there are lots of applications coming every week built using twitter APIs. Twitter becomes a good platform for promoting your blog as well as products. In order to help bloggers, i today wrote this script which adds “TweetThis” button to your blog.

This looks like below :

image

This will allow your blog readers to tweet about your blog post.  I uses APIs from TinyURL to make sure your long blog post url shrink to smaller size to fit into the 140 characters limit. The tweet format will be as below:

Post_Title-TinyURL

TinyURL is url of your blog post after shrinking.

What You Have To Do ?

Just add a small java script code your your blogger.com blog. Go to your blogger.com account. Then click on “Layout” option. Then click on “Layout” tab. Click on “Add a Gadget”. Then select “HTML/JavaScript”. See the steps in below image :

image

Copy – Paste below javascript code and you are done.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

<!-- Begin tweetthis script code -->
<script type="text/javascript">
pTitle=document.title;
document.write('<div id="tweetthis" style="float:left; height: auto; width: auto;"></div>');
</script>
<script src=http://smashingfeeds.com/tools/tweetthis.js type="text/javascript"></script>
<!-- End tweetthis script code -->

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I am not sure about other blogging platforms(wordpress, typepad, etc…).

Possible Advantages

  • Increase your blog visibility
  • Increase subscriber counts
  • More followers
  • More Traffic
  • Increase monthly revenue

If you like this script, then feel free to follow me on twitter @blogfisher



You may be interested in below posts too !!





16 comments:

YvonZ said...

hi
When i use this tweetTis button on the following page:
http://games.allemaal.info/search-engine-result-page.php?cref=http%3A%2F%2Fgames.allemaal.info%2Fcontext-g4g-nl.xml&cof=FORID%3A9&q=tetris&sa=Search#1070
it twitters wrongly:
http://games.allemaal.info/search-engine-result-page.php?cref=http://games.allemaal.info/context-g4g-nl.xml
How can i make this work?

Kevin said...

Hello YvonZ,
Issue has been fixed.

The Dotterel said...

This is great, and I've added it already. Question: on other sites I've seen it linked to individual post, rather than the whole site. How is this done?

Brian French said...

Is TweetThis gone or is the service just down? My pages are lagging when trying to process this script and when the page finishes loading, the area where there should be a Tweet This is blank. - Thanks!

Brian French said...

Nevermind-it's working again! Thanks for this service!

Greg said...

Kevin, this is perfect--no popup or registering, and a short TinyURL--just what I was looking for. I would really like to have this appear after every post (post-footer) rather than a gadget, which give me a link for the blog page, rather than a post. How do I do this in Blogger?

msmarketerintraining.com said...

The Dotterel...I thought it was only tweeting the general site also. But if you go directly to a post and then click the "TweetThis" button, it will tweet that exact page.

♥georgie♥ said...

Thanks so much...I have been looking for something just like this LOVES IT!

Stuart said...

Hi Kevin, thanks very much for that. How did you get the twitter link at the end of every post instead of at the side bar? Stuart

PIERRE said...

Hi,

is there also a possibility to customize text and colour of linktext?

Usually I use bit.ly to shorten my URLs. Does this Script also works with this?

Best Regards
Pierre

Sweet Bea said...

Kevin,

I'd like to follow up on Stuart's above comment - how do you get the tweetthis button from the sidebar to the bottom of the post, as you have on this site? Many thanks!

Modern Hippie said...

I've been trying to add the twitter link to bottom of every post as well, how is this done? Thanx!

Mr. Green said...

wow I've been looking for this code for so long, I finally found it. Thank you very much

Snoozepossum said...

Score! Thanx muchly! Thou rockest.

Lantaw TV said...

please provide screen shots..thank you...

Anonymous said...

Hello
I use your "TweetThis" Button

As my page is in German, I find it not so good that it is at Twitter (This is really interesting - http://tinyurl.com .....).

Could you send me the (http://smashingfeeds.com/tools/tweetthis.php?url =), so that I can adapt this to my needs?

Excuse my English = Google Translation

Thank you
vanessa.hartmann (at) gmx.ch