Valid XHTML <object> Tags for Twitter Feed - Web Team Procedures and Notes

This page is intended for use only by the Web Team.

NOTE: Subject to change.

Go to Code for Video, Slideshows, and more.

Embedding a Twitter Feed using Javascript (not <object> tag)

NOTE: Tested and validates. FAST (unless Twitter is slow or down). Looks like regular text so should be styled - note use of id="twitter_update_list".

<div class="embeddedmedia twitter rightfloat" style="border:1px dashed #000000; width:400px;">
<ul id="twitter_update_list">
  <li>Loading...</li>
</ul>
<script src="http://twitter.com/javascripts/blogger.js"></script>
<script src="http://twitter.com/statuses/user_timeline/ohlonecollege.json?callback=twitterCallback2&amp;count=5"></script>
</div>
  • Change number of tweets displayed by changing "count=5" to another number (example: count=3)
  • Best to move <script> tags to bottom of page so page content loads even if Twitter is slow or down
  • Border added to above example to emphasize the output of the code
  • Cannot add <li> item after the first one - it won't be displayed
  • Code above is modified a bit from the code found on from www.twitter.com