I am just playing around with Twitter’s PHP Library twitterlibphp and created this little application.
You can see the results here.
Below you can see the code that produces this simple example application.
<div class="twitter_container">
<?php
// Inlcude the Twitter Library
require_once 'twitter.lib.php';
// Instantiate the Twitter Object
$twitter = new Twitter("DanTheMan_nz", "lordofcrow666");
// Make the call to get the public timeline
$public_timeline_xml = $twitter->getPublicTimeline();
// Wrap it in an XML element
$twitter_status = new SimpleXMLElement($public_timeline_xml);
// Iterate through the xml objects
foreach ($twitter_status->status as $status)
{
// Iterate through the user objects
foreach ($status->user as $user)
{
// Bring the user's image on the screen
echo '<img src="' . $user->profile_image_url . '">';
// and the user's name
echo '<a href="http://www.twitter.com/' . $user->name . '">'.$user->name.'</a> :';
}
// Print out the status
echo $status->text;
echo '<br />';
// and the date it was created
echo '<div>Posted at:' . $status->created_at . '</div>';
}
?>
</div>
And here is the css code to style the whole thing a little bit.
.twitter_container{
color:#444;
font-size:12px;
width:600px;
margin: 0 auto;
}
.twitter_container a{
color:#0066CC;
font-weight:bold;
}
.twitter_status{
height:60px;
padding:6px;
border-bottom:solid 1px #DEDEDE;
}
.twitter_image{
float:left;
margin-right:14px;
border:solid 2px #DEDEDE;
width:50px;
height:50px;
}
.twitter_posted_at{
font-size:11px;
padding-top:4px;
color:#999;
}
It is pretty self explanatory. If you still have a question you are welcome to leave a question in the comments.
This example is based on Antonio Lupetti’s tutorial which can be found here.

Hi,
seems simple and fine, just the result seem to be much more sophisticated (are those threads?) than the code, so I suppose, you made some updates in the meantime that are not reflected in this article.
where do i place the css code and how do i reference it into my php file.
Thanks in advance…