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












Add New Comment
Viewing 3 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)