<?php /* Retrieve last Twitter status. Copyright 2009 Alessandro Ghedini -------------------------------------------------------------- "THE BEER-WARE LICENSE" (Revision 42): Alessandro Ghedini wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. -------------------------------------------------------------- */ $screen_name = "Al3xBio"; $url = "http://twitter.com/statuses/user_timeline.xml?screen_name=$screen_name&count=1"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); $src = curl_exec($c); curl_close($c); preg_match('/<text>(.*)<\/text>/', $src, $m); $status = $m[1];//htmlentities($m[1]); $status = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=\"_blank\">\\0</a>", $status); echo "<img src='http://img291.imageshack.us/img291/4716/twitterc.png' align='absmiddle' /> <a href='http://twitter.com/$screen_name' target='_blank'> $screen_name</a> - $status <br />\n"; ?>
AlexBio's Blog
