How To Implement a JQuery Based Twitter Widget On Your Website For Your Visitors To Post Tweets Without Leaving Your Page.

Twitter is definitely a great medium to share information with your friends, but to share links via twitter on sites developers use 3rd party web apps that redirect you to their websites or you have to manually shorten them and share it using twitter.Some desktop alternates like TweetBox and browser addon are also good alternatives, but you can offer your visitor the best interaction with Twitter from your website/blog to share your posts using  Like it? Tweet it! a JQuery Plugin which is based on Twitter’s new anywhere API which does not require any API key and has just a few lines of code that need to be added to your site and you have a very nice implementation for your visitors to share your posts via Twiiter.

Also Checkout These Twitter Apps –

jquery-twitter-plugin

Here’s what you’ll need – JQuery installed.

  • Check if JQuery is already installed and If JQuery is not installed you can add the following code to your header tag <head>

 

<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js“></script>

 

Note : Check if you website is already using JQuery, if it is.You can skip the above step.

  • Next add this piece of code after adding the JQuery Code,in the head ie., the <head> tag

<script type=”text/javascript” src=”http://tweet-it.s3.amazonaws.com/tweet-it.js”></script>

  • Next Add this function in the header

<script type=”text/javascript”>

$(document).ready(function(){

$(“.tweet-this a”).tweetIt({animate: “slide”,

header: “Tweet My Stuff!”,

closeButton: “Close this panel and cancel tweet”,

tweeted : “Tweet Posted”,

signoutLink : “Sign out?”,

youare : “You’re”,

emptyConfirm : “Are you sure you want to send a tweet with just the link?”

});

})

</script>

The widget accepts more keys ie., for example –> animate: “slide” etc., using which we can customize the options on the widget.

Similar Post  Create Snowfall Effect This Christmas On Your Site Using JavaScript

The widget can also styled to suite your site and the css file can be added as a key in the following format.

cssFile: http://example.com/styles.css

The complete list of supported keys can be referenced here under Configuration.

  • Next The Last step, Add this code from where you want to call the function, you can also replace the text with a image.

<p class=”tweet-this”><a href=”javascript:function()”>Like it? Tweet it!</a></p>

The widget automatically gets the URL and shortens it, but remember it does not get the Post Title, the user has to manually type the tweet.

It also supports 3 popular blogging platforms, WordPress, Tumblr, and Blogger.There also a WordPress plugin available which makes it easier to set it up in WordPress.

Like it? Tweet it! WP Plugin

Share with us your thoughts on this JQuery Plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.