$username='xjb';//change this to your twitter username修改为你的twitter 用户名
$feedURL='http://twitter.com/statuses/user_timeline/'.$username.'.rss';
$excludePattern='/'.$username.': @/'; //excludes any @replies排除@replies 内容
$count=5;// show count
$i=0;
if(!$xml=simplexml_load_file($feedURL)){
trigger_error('Error',E_USER_ERROR);
}
foreach($xml->channel->item as $item) {
if ( ! preg_match("$excludePattern", $item->title)) {
$filteredTitle=htmlspecialchars("$item->title");
$filteredTitle=str_replace("$username: ","",$filteredTitle);
//Convert the time zone in China --转成中国时区
date_default_timezone_set('Asia/Shanghai');
$i++;
if($i>$count)
{
break;
}
?>
(pubDate)); ?>)
$username='xjb'; //change this to your twitter username --修改为你的twitter 用户名
$feedURL='http://twitter.com/statuses/user_timeline/'.$username.'.rss';
$excludePattern='/'.$username.': @/'; //excludes any @replies --排除 @replies 内容
$count=5;// show count
$i=0;
if(!$xml=simplexml_load_file($feedURL)){
trigger_error('Error',E_USER_ERROR);
}
foreach($xml->channel->item as $item) {
if ( ! preg_match("$excludePattern", $item->title)) {
$filteredTitle=htmlspecialchars("$item->title");
$filteredTitle=str_replace("$username: ","",$filteredTitle);
date_default_timezone_set('Asia/Shanghai'); //Convert the time zone in China --转成中国时区
$i++;
if($i>$count)
{
break;
}
?>
(pubDate)); ?>)