$id=hongxiaowan;
$tag=friendfeed;
if($tag!=”"){
$xmlurl=”http://api.zuosa.com/tag/search.xml?id=”.$id.”&tag=”.$tag.”&ec=utf-8&count=20″;
}
if(($id==”")&&($tag==”")){
$xmlurl=”http://api.zuosa.com/statuses/public_timeline.xml”;
}
if(($id!=”")&&($tag==”")){
$xmlurl=”http://api.zuosa.com/statuses/user_timeline.xml?id=”.$id.”&count=20″;
}
$xml= simplexml_load_file($xmlurl);
if(count($xml) > 0)
{
foreach($xml as $item)
{
$temp1 = ”;
$temp = “”;
if ($item->mms_img!=”")
{
$temp = ‘<br><img src=”‘.$item->mms_img.’” class=”media-image” title=”‘.$item->text.’”/>’;
}
switch($item->media->provider)
{
case “url”:
$temp = ‘<br><embed src=”http://www.zuosa.com/badge/player/player.swf” flashvars=”sndfilename=’.$item->media->mediaid.’” wmode=”transparent” quality=”high” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” height=”18″ width=”48″></embed>’;
break;
case “8box”:
$temp = ‘<br><embed src=”http://www.8box.cn/’.$item->media->mediaid.’.swf” type=”application/x-shockwave-flash” width=”48″ height=”18″></embed>’;
break;
case “56″:
$temp = ‘<br><embed src=”‘.$item->media->mediaid.’” type=”application/x-shockwave-flash” height=”400″ width=”500″></embed>’;
break;
case “Sina”:
$temp = ‘<br><embed pluginspage=”http://www.macromedia.com/go/getflashplayer” src=”http://vhead.blog.sina.com.cn/player/’.$item->media->mediaid.’” type=”application/x-shockwave-flash” name=”ssss” allowFullScreen=”true” allowScriptAccess=”always” height=”400″ width=”500″></embed>’;
break;
case “Youku”:
$temp = ‘<br><embed src=”http://player.youku.com/player.php/sid/’.$item->media->mediaid.’/v.swf” quality=”high” allowscriptaccess=”sameDomain” type=”application/x-shockwave-flash” height=”400″ width=”500″></embed>’;
break;
case “Youtube”:
$temp = ‘<br><embed src=”http://www.youtube.com/v/’.$item->media->mediaid.’” type=”application/x-shockwave-flash” wmode=”transparent” height=”400″ width=”500″></embed>’;
break;
case “tudou”:
$temp = ‘<br><embed src=”http://www.tudou.com/v/’.$item->media->mediaid.’” type=”application/x-shockwave-flash” allowfullscreen=”true” wmode=”transparent” allowscriptaccess=”always” height=”400″ width=”500″></embed>’;
break;
case “QQ”:
$temp = ‘<br><embed type=”application/x-shockwave-flash” src=”http://video.qq.com/res/qqplayerout.swf?’.$item->media->mediaid.’” id=”flashplayer” name=”flashplayer” quality=”high” allowscriptaccess=”sameDomain” allowfullscreen=”true” flashvars=”vid=3yXJEJA17UC&cgi=http%3A//video.qq.com/bin/vrank%3Ftype%3D8%26start%3D25%26end%3D32″ height=”400″ width=”500″></embed>’;
break;
case “yupoo”:
$yupooid=explode(“,”, $item->media->mediaid);
$temp = ‘<br><img src=”http://photo’.$yupooid[0].’.yupoo.com/’.$yupooid[1].’/’.$yupooid[2].’.jpg” class=”media-image” title=”‘.$item->text.’”/>’;
break;
}
//link
preg_match_all(“/[A-Za-z]+://[A-Za-z0-9-_]+.[A-Za-z0-9-_:%&?/.=]+/”,$item->text,$tmp);
$post_link_temp = “”;
foreach($tmp[0] as $key => $value){
if (preg_match(“/[A-Za-z]+://[A-Za-z0-9-_]+.[A-Za-z0-9-_:%&?/.=]+/”,$value)){
$post_link_temp.= ‘ <a href=”‘.str_replace(“]”,”",str_replace(“[","",$value)).'" target="_blank">link</a>';
}else{
}
}//link
//tags
preg_match_all("/[[^]]+]/”,$item->text,$tmp);
$post_tags_temp = “”;
foreach($tmp[0] as $key => $value)
{
$valuetag=explode(“,”, $value);
foreach($valuetag as $key => $valuetagsingle)
{
$valuetagsingle=preg_replace(“/[A-Za-z]+://[A-Za-z0-9-_]+.[A-Za-z0-9-_:%&?/.=]+/”,”",$valuetagsingle);
if ($valuetagsingle!=”"){
if (strstr($valuetagsingle, “t:”)){
$post_title_temp = str_replace(“t:”,”",str_replace(“]”,”",str_replace(“[","",$valuetagsingle)));
}elseif(strstr($valuetagsingle, "n:")){
$post_text_temp = str_replace("n:","",str_replace("]“,”",str_replace(“[","",$valuetagsingle)));
}else{
if((str_replace("]“,”",str_replace(“[","",$valuetagsingle))!="视")&& amp;(str_replace("]“,”",str_replace(“[","",$valuetagsingle))!="图")&& amp;(str_replace("]“,”",str_replace(“[","",$valuetagsingle))!="音")&& amp;(str_replace("]“,”",str_replace(“[","",$valuetagsingle))!="博")){
$post_tags_temp= str_replace("]“,”",str_replace(“[","",$valuetagsingle));}
}
}
}
if($post_tags_temp!=""){$post_tags_temp=" 关于 #".$post_tags_temp." 的消息";}
}
//tags
//content
if ($post_text_temp==""){$post_text_temp=preg_replace("/[A-Za-z]+://[A-Za-z0-9-_]+.[A-Za-z0-9-_:%&?/.=]+/”,”",$item->text);$post_text_temp=preg_replace(“/[[^]]+]/”,”",$post_text_temp);}
//content
//title
if ($post_title_temp==”"){$post_title_temp=$item->user->name.$post_tags_temp.” @ “.date(‘y-m-d H:i:s’, strtotime($item->created_at)+$timezone*3600);}
//title
$post_title_temp=$post_title_temp;
$post_link_temp=”http://www.zuosa.com/statuses/”.$item->id;
$post_author_temp=$item->user->name;
$post_content_temp = $temp1.$post_text_temp.$temp.$post_link_temp;
}
}
- Reuters article mentions Zuosa.com » small Chinese firms are much cheaper for investment and foreign funds believe some of them will be leaders.,
- hellotxt added zuosa » Then, you can update zuosa.com via hellotxt.
- Zuosa API Documentation » translated by guxiaoqiang@zuosa.com
- Made in Wordpress: miniblog » Also have a P2 Theme.
- Google Tagged Links » This wordpress plugin based on Google REST Search API, Zuosa Tag Plugin and idea from Google Related Links.,
- Google’s solar LCD Monitor » LED lamp can save much Energy, Solar is a 41 joke, haha
