Jo$h
Posting Freak
- Jul 7, 2010
- 1,030
- 79
This is a Script written by
ScreenShot:
You must be registered for see links
I have made a few modifications to it, so that it also loads the avatar in a nice and easy way as well. Thanks again to Mark for doing 95% of the script ScreenShot:
You must be registered for see links
PHP:
<?php
function twitter( $username )
{
// What is the file format for your avatar?
// jpg, png, gif
$file_format = "jpg";
$twitterurl = file_get_contents( "http://twitter.com/statuses/user_timeline/{$username}.xml?count=1" );
$xml = new SimpleXMLElement( $twitterurl );
$s = $xml->status;
$text = $s->text;
$twitteravatar = "http://api.twitter.com/1/users/profile_image/{$username}.{$file_format}";
echo "<img src='{$twitteravatar}' alt='{$username}'s Twitter' style='height:30px; width: 30px;'>";
return $text;
}
echo twitter(twitter);
?>