What's New at CTO 2.0 ...

Oct 20

Written by: Antonio Chagoury
Monday, October 20, 2008 

I am currently working on a new skin for my Blog, as well as revisiting the overall user experience of this site. Since I Tweet quite a bit, I figured that displaying the list of my latest 5 Tweets would be a neat idea. A couple of thoughts came to mind, including writing a module that would consume the Twitter API to retrieve my tweets. After doing some researching around, I found that there is a much much, much simpler way to do this with a little (already provided) JavaScript.

First, add the following html UL element somewhere on your page:

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

Then add the following script directives to the bottom of the page (the closer to your end </body> tag the better):

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

You'll also notice that I marked-up some of the code in red. The first item should be replaced with your Twitter usersname (otherwise you will get my Tweets on your page!), the second item, is the number of last tweets you wish to display.

Pretty simple uh?

Enjoy!

 

Tags:

1 comment(s) so far...

Re: Displaying your Twitter Status on Your Home Page or Blog

Bit of a newbie.... on JS and Twitter. But built several DNN sites. Can't get your JS to work in Text/HTML module. Probably something very basic/stooopid.

Can you let me have the code you put in your Text/HTML module which displays the Twitter feed (in the right pane).

By Ian Gotts on   Tuesday, December 09, 2008

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 

RSS Snapshot

Antonio Chagoury - Microsoft MVPAntonio Chagoury
Software Architect, Microsoft MVP, Open Source Advocate, Golfer, Cigar Afficionado
Washington DC - USA
Company: Inspector IT, Inc.
Profiles: LinkedIn &

Antonio Chagoury - Microsoft MVP

RSS Read it in your RSS reader

 
Add to Google Reader Add to Bloglines Add to My Yahoo Add to Netvibes
 

Tag Cloud

2008   add   blog   code   community   control   data   dnn   dotnetnuke   get   google   great   group   just   know   live   may   microsoft   module   net   new   page   post   presentation   see   sharepoint   support   sure   time   use   user   way   web   windows   work  

 

    Archives

    Blog Roll