I’ve got a nice little twitter widget on my website that was created using php. I’d like to be able to make sure that when a link appears it is clickable or when I @reply someone it links to their profile. Any help is greatly appreciated.
<?php
function getTwitterStatus($userid){
$url = "http://twitter.com/statuses/user_timeline/$userid.xml?count=1";
$xml = simplexml_load_file($url) or die("could not connect");
foreach($xml->status as $status){
$text = $status->text;
}
echo $text;
}
getTwitterStatus("UltanKC");
?>
I have a function which I use for this – it will make links for URLs, twitter user names and twitter hashtags.
to use it with your code, edit the line which echoes out the status: