How To Create Tweet & Follow Button In Your Web Application

Twitter is great for sharing interesting things you find on the web. In fact, close to a quarter of all Tweets include a link in them. Despite the high volume of sharing, there is plenty of room to make it easier.
So, I have recently created “Share on Twitter” functionality in my application. Now you can use this functionality too with yours application.

Lets quickly start to add Tweet Button
For try out your button, you just copy and paste the below code into the HTML
where you want to add tweet button.

<a target="_blank" id="b" class="" 
<span id="l" class="">
<img src=""images/twitter.png")" alt="Tweet" title="Click to share on Twitter"/>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];

Note : In above code you can configure tweet button accordingly, For ex.
text: You can give Tweeting contents within text.
image: Under img src you can give tweet button image which one you like

Once you add above code in your application then you can get tweet button functionality with your application. After clicking tweet button following twitter signin window appear,


After Sign in tweet window appear as given below


Same as Tweet Button you can also create Follow Button for Twitter.
For achieve this functionality you can just copy and paste below code in your html.

<a href="" class="twitter-follow-button" data-show-count="false">Follow @singhsomvanshi</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];

Following window look like as below


I hope you will enjoy using this Tweeting and following button funtionality in your web application. Please try this out for yourself to see how it works.

About anuj2013

Software Consultant At Knoldus Software LLP
This entry was posted in Web and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s