Following on from the Twitter Search script comes this one that allows me to view my Twitter Stream.

Twitter as you know is a page that is blocked at work and as someone who has an interest in what is going on in the world this dissapoints me.

The script was made possible thanks to a service called GTweet which after you authorise it produces a publicly available RSS feed of your stream which my script uses for it’s output.

This script integrates with my other Twitter script to give you a full Twitter experience.

echo "
<h1>Twitter Stream</h1>
<div class="tweets">";
$url = $_POST["u"]; // get the URL supplied

$rss = new rss_php;
if ($url != ""){ // if the URL is not blank then use it
}else{ // otherwise use my URL
$tweets = $rss->getItems(); // get items from the RSS feed

foreach ($tweets as $tweet){
$html = new simple_html_dom();

$usr = $html->find('td a',0);
$usrl = $usr->plaintext; // username on it's own
$usr = $usr->outertext; // username with <a> and the lot
$usr = str_replace("<strong>","",$usr); // used to stop my css applying to the username
$usr = str_replace("</strong>","",$usr);
$usr = str_replace("","".$usrl,$usr);</a>

<a>$posts = $html->find('font',0);
$posts = explode("
$post = $posts[0];
$post = str_replace("","",$post);
$post = str_replace("","",$post);
$post = str_replace("href=\"","href=\"",$post);
$post = str_replace("href=\"","href=\"",$post);
$post = str_replace("href=\"","href=\"",$post);

echo $usr .": ". $post ."

"; // print the username and post
echo "