MyTwit - a PHP Twitter reader

About MyTwit

MyTwit is a PHP class used to embed a Twitter user's public comments into a web page. It keeps it's own cache, and (by default) updates only every 5 minutes when the page is loaded to prevent overloading twitter (and possibly getting banned). MyTwit requires no JavaScript, and outputs pure XHTML which can be styled with CSS. It does not require libcurl as it contains it's own PHP downloader (using sockets) and requires json_decode() to decrypt the twitter feed.

Demo

To view a demo of MyTwit view my own Twitter page.

Download

Configuration / Usage

MyTwit requires PHP, json_decode, and read/write permissions to a cache file.

<?php
   include('mytwit.inc.php'); // Include the library
   $twitter = new myTwit(); // Call MyTwit class
   $twitter->cacheFile = 'tmp/cache.txt'; // Read/write a local cache
   $twitter->user = 'tjralph'; // Set the user to get info from
   $twitter->postLimit = 10; // Optional: Set the post limit ~ max 20 posts
   $twitter->initMyTwit(); // Generate the stuff
   echo $twitter->myTwitData; // Display the html
?>

See the included index.php file for a CSS styling example.