A Simple “Tweet This” Form

in Uncategorized

Want your readers/members to have the ability to retweet some of your content? It’s a great way to spread the word and has worked wonders for ThumbVu.

I’ve made it as EASY as possible for you to do this.

All you have to do is put the below code where you want the Tweet This box to show, and that’s it! Of course, you’ll probably want to change the content of the tweet, so just change what’s in between the quotes after var tweet_content, so var tweet_content = “Your content”;. A couple rules for that, DO NOT start a new line, and if you put in quotes put a backslash \ before them. Also note that Twitter has a character limit of 140.

<script type='text/javascript'>
var tweet_content = "Want an easy way to add a \"Tweet This\" box to your site? http://austinhallock.com/short/16";
</script>
<div id='tweet_this' style='display:none;'></div>
<script type='text/javascript' src='http://www.austinhallock.com/tweet_this.js'></script>

You can see an example of this below. (If you’re in an RSS reader, this probably won’t show, so click here to see it.

Pretty cool huh?

If you want a bit of customization, you can add the following after var tweet_content = ‘whatever’;. The first will change the background color of the box, the second will change the font color.

var tweet_bgcolor = '111111';
var tweet_color = 'EEEEEE';

You can also allow the users to change what’s in their tweet by adding:

var tweet_textarea = 'T';

As always, let me know what you think!

9 Comments

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

9 Comments

  1. Thanks Austin…Simple & Easy for us "Non-Techy's" LOL
    Patti/SilverDark

  2. Looks good, I'll try it out!

  3. Very nicely done, Austin!
    Even the 'technically-challenged' can 'pimp their page' with this one…

    Carl Bailey
    InstantSplash.com

  4. wow Austin!
    that looks so easy will be testing this a little later
    Kepp up the good work

  5. Yes, Austin I7d like to add my kudos to Carl Bailey's endorsement! While I am a little skittish about actually implementing it to my posterous blog I am going to try to add it to my new site on webstarts and I will also give it a whirl on my new hosted website on 000webhost.

    I am pleased to be becoming one of your raving fans!

    Best wishes from Yokohama, Japan and keep up the great coding!

  6. Thanks for all your kind words! I'll keep working towards providing some good content for you all :)

  7. Austin, I love this tip. Thanks.

  8. I can’t help but laugh when I read them. All I can do was nod in agreement! Hahaha.

  9. Rhonda Morton

    Thanks for your code, with little effort I"ve successfully tweeked Raven-surf.com for Tweeting :)

    Have a great day!!

Leave a Reply

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>