AboutContact Us Copyright Privacy Statement Sitemap Advertise on Globinch.com
  • Home
  • Browser Tips
  • Microsoft
  • Tools & Tips
  • Blogging
  • Freeware
  • Google
  • SEO Guide
  • Social Media
  • Website Optimization
  • Wordpress Tips
►Home►Social Media►

Write your own Twitter widget in (Recent Tweets) 3 steps using twitter API.

  • By Binu George
  • On: April 7, 2010
  • In: Social Media
  • Comments [10]
Search Globinch :
  • Tweet

There are plenty of twitter widgets available that are ready to use. But the problem with all these widgets are that you cannot change it’s look and feel as the way you want.So better let us create our own widget so that we can use that for our purpose.
Read: 5 best and useful twitter applications.
We are going to create a very simple widget that displays the recent tweets.The widget just displays the most recent 10 tweets of your twitter account.This is a basic widget.We will discuss building more complex twitter widgets in the future tutorials.
You can change the number of tweets here by changing the count value.
The tweets will be displayed inside a “div” element. You can apply styles to this div by changing the CSS script given in step 3.

Step 1: First we need to create a “div” and place it in your web page where you want the widget to appear.

1
2
<div id="#twitter_update_list">
</div>

The id of the dive denotes the CSS style ID.That is explained in Step 3.
Step 2: Now we nedd to script which actually uses the Twitter API to get the recent tweets.The code is given below. You just need to copy and paste the below code just below the code given above (Step 1).You can place anywhere on the page. Better keep it at the very end of your page, before . This will helps the rest of your page to load first.

1
2
3
4
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js">
</script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/globinch.json?callback=twitterCallback2&amp;count=10">
</script>

You need to replace the “globinch” with your own twitter user name.You will only be able to access the latest 3200 statuses from a user’s timeline due to pagination limits.In the above code we are getting the recent 10 tweets (count=10).You can change this as you wish.

Step 3: Now let us beautify the widget
If you know how to write css style scripts you can. If not just copy paste the below code to your CSS style file. If you don’t have one just add the below code in your web pages between tags.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<style>
#twitter_update_list{
display:block;
margin: 0 auto;
width: 670px;
background:#D3D3D3;
border: solid #0000FF;
border-width: 2px 2px 2px 2px;
padding:5px;
display: block;
height: 200px;
font-style:bold;
}
#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: #333;
font-family:Arial, Helvetica, sans-serif;
font-size:10px;
font-weight: bold;
color: #7d716d;
margin: 0;
padding: 0px 0 0;
}
</style>

Done! The above widget will appear as below.

recent_tweets_twitter_widget

Thank you for reading!

I'd love to hear from you as well. Please post your comment below or tweet me @globinch. or please plus one Globinch
If you loved reading this blog, please do subscribe globinch and share this post using the below buttons.

Tweet
Binu George , the author of Globinch.com, is a technology blogger from India and a software solution architect by profession.
Related Posts with Thumbnails
Search Globinch :

Globinch.com Sponsors/Advertisements:
Cloud VPS Hosting 291653_Nero 11 Platinum

10 Comments

  1. RS
    Posted May 20, 2010 at 5:12 PM

    Is it possible to create a break between the tweet content and the timestamp?

    Reply
    • Munt
      Posted June 9, 2010 at 5:19 PM

      in css
      #twitter_update_list span
      put “display:block;” to separate time stamp. Good luck!

      Reply
  2. Antone Dockstader
    Posted January 21, 2011 at 10:56 AM

    The problem with the FB like button is that it generates a TON of http requests just for that little button. I’d rather have something simple like the twitter follower widget.

    Reply
  3. Lilian Coontz
    Posted March 28, 2011 at 4:54 AM

    SEO social – the new way of getting traction in the online social space. The rules are changing and your business must keep up to date with the developments in socialnetworks such as Facebook, LinkedIn and other social networks.

    Reply

Trackbacks / Pings

  1. Connect,share and update all your social networks in one place using Yoono | Globinch
  2. Make Long Hyperlinks to Short: Best URL Shortening Services | Globinch
  3. Backup Your Twitter Account and tweets ,followers , friends and archives | Globinch
  4. Backup Your Twitter Account Tweets Friends, followers Using Twitter API | Globinch
  5. Best Tips and Tricks on Twitter and Facebook - A Tutorial | Globinch
  6. How To Display Twitter Followers Count as Text | Globinch

Leave a Reply




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Cancel Reply

  • Sign up for updates or join Globinch on Social Media
    • Stay Connected

      Subscribe FREE updates on your Email | RSS

      Like us on Facebook
      Circle us on Google+
  • Follow globinch
  • Most Popular Articles
    • Search Engines for File Sharing Sites : Rapidshare Search, Megaupload and More: 6 comment(s) | 14347 view(s)
    • Google Translate Now supports Bengali, Gujarati, Kannada, Tamil and Telugu: 2 comment(s) | 13591 view(s)
    • Turn your Windows 7 Computer Into a Personal Wi-Fi Hotspot: 13 comment(s) | 12299 view(s)
    • Google Top Searches Today – Hot Google Search Words today: 12 comment(s) | 10902 view(s)
    • Best PDF OCR Tools to Convert Scanned images to Text / Word Documents: 20 comment(s) | 7468 view(s)
    • Free Online OCR Software to Convert Images Into Searchable PDF, Doc, HTML or Text: 3 comment(s) | 6396 view(s)
    • Password Revealer – How To Reveal- Show Password Behind Asterisks?: 7 comment(s) | 6353 view(s)
    • Play Angry Birds Game Free and Offline in Chrome Browser: 0 comment(s) | 6312 view(s)
    • Access Blocked sites, Unblock Restricted Websites: 13 comment(s) | 5570 view(s)
    • Most Searched Words and Most Popular Keywords on Internet: 10 comment(s) | 5186 view(s)
  • Most Recent Articles
    • Top 10 Rapidshare Download Manager Tools
    • SEO for Mobile Website. Top 10 Mobile Site SEO Tips
    • Mobile XML Sitemap and Google mobile Sitemap Generator Tools
    • Top 50 Ways to Increase Traffic to Blog or Website
    • 404 Error Page Design How to Guide and Best Practices
    • Benefits of Defining Relationships with XFN Microformats
    • How to Make Your Website Google Friendly?
    • WordPress Permalink Change, htaccess 301 Redirect and Subdomain
    • Permalinks in WordPress: SEO and Performance Factors
    • How to Build Free Backlinks? Efficient and Safe Strategies

Join The Globinch Tech-Knowledge Community

Globinch RSS Feed

You can choose from three options, sign-up for our Newsletter, join us on Facebook, or follow us on Twitter. Globinch provides technology how-to guides on blogging, website optimization,freeware reviews,Social Media Guides, Windows Tips, Tools and Tips on internet,computers and much more...

Globinch Mail Sign-Up

Sign-up for the Globinch Tech-knowledge newsletter and find out the latest and popular technology helps and how to guides. We will keep you up-to-date!

Our Facebook

Join us on Facebook and share the best technology updates, guides, videos and other cool information directly with all your friends.

Join and follow the best of Globinch on Facebook

Twitter Us

Follow Globinch Tech-knowledge and you'll be able to catch up daily on our latest content. @ Globinch. join the Twitter Globinch community

Join and follow the best of Globinch on Twitter

About The Author

Binu George, the author of Globinch.com, is a technology blogger from India and a software solution architect by profession. Contact : Email:   binu@globinch.com  

Google+
DMCA.com

linkedin_32 stumbleupon_32 friendfeed_32 google_32globinch_digg
Copyright © 2009-2011 Globinch. All Rights Reserved. Articles cannot be reproduced without permission from the author.
Contact Us | Copyright Info | Terms of Use | Trademarks | Privacy Statement| Sitemap Advertise
Write to me at Contact Us if you have any comments, questions, suggestions about this site or would like to send us a tip.
SiteLock
Besucherzahler ukrainian brides
website counter

Real Time Web Analytics
SEO Powered by Platinum SEO from Techblissonline

Switch to our mobile site