setUserAgent("Mozilla/5.0 (compatible; TwitterCacher/1.0; +http://www.kolich.com)");
$timeline = $json->decode(
$tc->getUserTimeline()
);
$count = 1;
$ul = new Ul();
foreach( $timeline as $tweet ) {
// Only show original posts, not my replies to
// other tweets.
//if(!empty($tweet->in_reply_to_user_id)){
// continue;
//}
$text = $tweet->text;
$date = date('M j, Y @ h:i A',
strtotime($tweet->created_at));
$source = $tweet->source;
$li = new Li();
$ul->appendChild( $li );
// Turn links into links
$text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '\\1', $text);
// Turn twitter @username into links to the users Twitter page
$text = eregi_replace('@([-a-zA-Z0-9_]+)', '@\\1', $text);
$li->appendChild( new Text($text) )->
appendChild( new Br() );
$em = new Em();
$em->appendChild( new Text($date) );
$li->appendChild( $em );
if($countappendChild( new Br() )->
appendChild( new Br() );
}
$count += 1;
}
echo $ul->write();
?>