Twitter Badge

Twitter Badge at GitHub

Example output of the script

I created this Twitter badge for two primary reasons. The official Twitter badge can be slow to load sometimes or doesn’t load at all due to the API limit. The other reason is that I don’t want @replies shown in my stream. The script is written in PHP and uses local file storage to cache the tweets.

Here are the features of the badge:

Usage:

  <div id="twitter-box">
    <h2>Twitter</h2>
    <ul id="twitter-updates"><?php include 'twitter_badge.php'; ?></ul>
  </div>

or with jQuery:

  $(document).ready(function(){
    $('#twitter-updates').load('twitter_badge.php');
  });

... elsewhere

  <div id="twitter-box">
    <h2>Twitter</h2>
    <ul id="twitter-updates"><li>Loading tweets...</li></ul>
  </div>