How to import and display your latest tweets
If you are an active Twitter user, chances are that you want to share your latest tweets on your website or blog. To do that it’s quite easy, just use the following PHP snippet.
<?php // import & display latest tweet
$username = "perishable";
$feed = "http://search.twitter.com/search.atom?q=from:".$username."&rpp=2";
// $prefix = '<h3>Perishable Press</h3>';
// $suffix = '<p><a href="http://twitter.com/'.$username.'">Follow me on Twitter</a>';
function parse_feed( $feed ) {
$stepOne = explode( '<content type="html">', $feed );
$stepTwo = explode( '</content>', $stepOne[1] );
$tweet = $stepTwo[0];
$tweet = str_replace( "<", "<", $tweet );
$tweet = str_replace( ">", ">", $tweet );
return $tweet;
}
$latest_tweet = file_get_contents( $feed );
// echo stripslashes( $prefix ) . parse_feed( $latest_tweet ) . stripslashes( $suffix );
echo parse_feed( $latest_tweet );
?>
Home

Nice article, just became a member and looking to creating my very own website designing tips article soon
but first some shut eye