Support Legal Downloads!

Automatic Twitter ‘Tweet This Page’ Button with Bit.ly URL Shortening

I have been helping out a friend that needed to add a Twitter button to a number of different pages. I could find lots of complex ways of doing this but not much in the way of reliable copy & paste solution that would capture the page title and also shorten the URLs.

I decided the easiest thing to do would be to put together a simple ASP.net web app that performed the URL trim, formatted the message and then redirected the user to twitter. I already knew I could use JavaScript to capture the page URL and Title.

After grabbing a bit.ly API key I found this .net DLL that makes working with the API super simple. Then I knocked up a simple button in English and Norwegian (for my friend).

The code to display the button is here and feel free to add it to any page you wish to be easily tweetable.

Incidentally, I made the button the same size as the ‘Share on Facebook’ button so they will sit nicely together. I will try to do some more buttons at some point.

Tweet This

This entry was posted in Social Media, webdev and tagged , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. Posted May 31, 2010 at 6:52 am | Permalink

    It looks good,I have learn a recruit!
    Recently,I found an excellent online store, the “http://www.air-jordan-18.com are completely various, good quality and cheap price,it’s worth buying!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*