===== キーワードでつぶやきを検索 ===== あすか'; $lng = 'ja'; $cnt = 50; $url = 'http://search.twitter.com/search.json'; $params = http_build_query(array('q' => $key, 'lang' => $lng, 'rpp' => $cnt)); $results = json_decode(file_get_contents("$url?$params"), true); $res = $results[results]; print <<< EOF EOF; foreach ($res as $i) { //echo ""; $val = $i["text"]; $val = ereg_replace("(http)(://[[:alnum:]\S\$\+\?\.-=_%,:@!#~*/&]+)","\\1\\2",$val); // $val = ereg_replace("(@)([[:alnum:]\S\$\+\?\.-=_%,:@!#~*/&]+)","\\1\\2",$val); $val = ereg_replace("(@)([[:alnum:]\S\$\+\?\.-=_%,@!#~*/&]+)","\\1\\2",$val); $val = ereg_replace("(>)(http://twitpic.com/)([[:alnum:]\S\$\+\?\.-=_%,:@!#~*/&]+)()",">",$val); $val = ereg_replace($key,$rep_key,$val); $img = $i["profile_image_url"]; $usr = $i["from_user"]; $uid = $i["id_str"]; $dat = date("Y年m月d日H時i分", strtotime($i["created_at"])); print <<< EOF EOF; } echo "

"; //echo "
";
//print_r($i);
//echo "
"; //echo "
{$val}
{$dat}

";