<?php
$url
= "http://sagool.jp/wacaalapi?clientUrl=http%3A%2F%2Ftatamilab.jp%2F&engine=web&type=xml";
$res = file_get_contents($url);

if((
$count = preg_match_all("|<item>.*?<title>(.*?)</title>.*?<link>http://sagool\.jp/s\?q=(.*?)</link>.*?</item>|s",$res, $match)) == 0){
    echo
"ダメっぽい";
    exit;
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Cache-Control" content="no-cache">
<title>Sagool最新検索キーワード</title>
</head>
<body>
<div align="center">
<a href="." accesskey="5">[5]再読み込み</a>
</div>
<?php for ($i = 0; $i<$count;$i++){
    echo
'[<a href="s.php?' . $match[2][$i] .  '">'. $match[1][$i] . "</a>]";
}
?>
<hr>
<center><small><font size="-1">
powered by <a href="http://sagool.jp/k/">オモロ検索エンジンSAGOOL</a>
</font></small></center>
</body>