Obama '08

Twitter updates on my sidebar

Posted: March 29th, 2007 | Author: EricaJoy | Filed under: twitter |

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Sticking some code here because its the easiest place to put it. I promise I have a real blog post sitting in draft status, I just get too distracted by things like this to finish it. :) Anywho, this is the code I used (largely borrowed from Jon Aquino) to put my last 5 twitters (tweets?) in a module over yonder –>
If you use it, be sure to change YOURUSERID to whatever your user id really is. If you don’t know what it is, click the RSS link @ the bottom of your Twitter profile. Your user id is the numbers before the .rss.

&lt;script type="text/javascript"&gt;<br />function twitterCallback(obj) {<br />var html = '';<br />for (var i = 0; i &lt; 5; i++) {<br /> html += '&lt;li&gt;&lt;a href="\"http://twitter.com/'+ obj[i].user.screen_name + '/statuses/' + obj[i].id +'\"&gt;' + obj[i].text +' &lt;/a&gt;&lt;/li&gt;';<br />}<br />document.getElementById('twitter_list').innerHTML = html;<br />}<br />&lt;/script&gt;<br />&lt;ul id="twitter_list"&gt;&lt;/ul&gt;<br />&lt;script src="http://twitter.com/statuses/user_timeline/YOURUSERID.json?callback=twitterCallback&count=5" type="text/javascript"&gt;&lt;/script&gt;

Well there it is. Maybe one day if I’m feeling froggy I’ll make it into a “real” Blogger widget. Don’t hold your breath though. ;)

Update: Fixed so it works with the changes made to Twitters API.

Share and Enjoy:
  • Print this article!
  • Google
  • MySpace
  • Reddit
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • StumbleUpon
  • Tumblr
  • Yahoo! Buzz

No related posts.


Viewing 3 Comments

 

Trackbacks

(Trackback URL)

close Reblog this comment
blog comments powered by Disqus