Hey guys, I was trying to implement a twitter feed script into my website to display my most recent tweet, and it works fine, but the links are broken. Go to http://sfrederick.com to see what I mean.
Here is the script:
<?
$username = "sfrederick1";
$prefix = "Latest Tweet: ";
$suffix = "";
$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1";
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;
}
$twitterFeed = file_get_contents($feed);
echo stripslashes($prefix) . parse_feed($twitterFeed) . stripslashes($suffix);
?>
Any ideas?