Please consider donating: a local project in memory of my daughter

Upgrade to Twitter JavaScript for your blog

I've been following the requests on the current Twitter JS plugin and decided to implement a few.

In particular there's now support for templates, which gives you full control of how the tweet is displayed.

I've updated the original page.

Templates are easy to write and insert into the li element that is printed. This way you can add your own classes, prefixes and suffixes as you please.

For example, here's is John Resig's twitters with friends based on the following template:

<span class="prefix">
  <img height="16" width="16" src="%user_profile_image_url%" />
  <a href="http://twitter.com/%user_screen_name%">%user_name%</a> said:
</span>
<span class="status">"%text%"</span>
<span class="time">
  <a href="http://twitter.com/%user_screen_name%/statuses/%id%">%time%</a>
</span>

Using this template, I've been able to wrap the status in quote and make the 'ago' time a link to the original twitter posting.

See the original add twitter to your blog post for a full list of template values and options.

Please wait while tweets load

One Response to “Upgrade to Twitter JavaScript for your blog”

  1. Is there any way to automatically make each list item a different class? For example class=tweet1, tweet2, tweet3, etc? This would be useful for me because I want each tweet to be a different color - the older the tweet, the darker the color, as if the list is fading out.

Leave a Reply
Not required

CODE: Please escape code and wrap in <pre><code>, doing so will automatically syntax highlight