// Include the SimplePie class require_once('path/to/simplepie.inc'); // Start the class $feed = new SimplePie(); // Tell SimplePie where our RSS feed is $feed->set_feed_url('http://twitter.com/statuses/user_timeline/7782732.rss'); // Tell SimplePie where our cache directory is $feed->set_cache_location('path/to/cache'); // Set the cache duration (in seconds) $feed->set_cache_duration(60); // Begin the processing $feed->init(); // Set the counter to zero $counter = 0; // Loop through each item on the feed foreach ($feed->get_items() as $item) { // Increment the counter $counter++; // Get the tweet (description in the RSS feed) $tweet = $item->get_description(); // Remove my name from the tweet $tweet = str_replace("Ben_Griffiths: ", "", $tweet); // Get the date $tweet_date = $item->get_date(); // Display the tweet echo '
'.$tweet.'
'.$tweet_date.'