How to display latest tweet in your website using Javascript and twitter API

No.of Views1029
Bookmarked0 times
Downloads 
Votes0
By  Prajeesh   On  18 May 2010 10:05:45
Tag : ASP.NET , How to
How to display latest tweet in your website using Javascript and twitter API.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

Sometimes you may be want to show your latest twitter tweets in your website or blog, most of the cases you are doing this by using widgets with limited customization facilities and showing ads or links to other websites, here is an easier way to achieve this using twitter API and javascript.

Step 1:

<div id="twitter_update_list">
</div>

First, decide where about on your page you want your last tweet to display. Then paste following html code there.

Step 2:

Next you need to put these 2 lines of JavaScript below the code in step 1. On the 2nd line of code where it says prajeeshkk.json, you need to replace prajeeshkk with your twitter username.

<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js">
</script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/prajeeshkk.json?callback=twitterCallback2&count=1">
</script>

Step 3:(Optional)

You can apply css and make the div displaying the tweet stylish.

#twitter_update_list li {
list-style-type: none;
}
#twitter_update_list span a
{
display: inline;
color: #008080;
}
#twitter_update_list span a:hover
{
text-decoration: underline;
color: #66CCFF;
}
#twitter_update_list span
{
color: #000000;
background: white;
}

See how my tweet design looks :

Image Loading

enjoy the twitter client withi your application.

 
Sign Up to vote for this article
 
About Author
 
Prajeesh
Occupation-Not Provided
Company-Not Provided
Member Type-Fresh
Location-India
Joined date-15 May 2010
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top