Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as PHP by andry ( 16 years ago )
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Yandex Wordstat Parser</title>
</head>
<body>
<form action="parser.php" method="post">
<p>
<strong>Query:</strong>
<input name="query" type="text" value="<?php print $_POST['query']; ?>" />
<input type="submit" />
</p>
</form>
</body>
</html>
<?php
function wordstat($query) {
if(strcasecmp(trim($query), "") == 0)return ;
// echo "query ".$query."</br>";
// $query = iconv('windows-1251', 'utf-8', strtolower($query));
$url = "http://wordstat.yandex.ru/?cmd=words&page=1&text;=".urlencode($query)."&geo;=&text;_geo=";
// echo "url ".$url."</br>";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.3) Gecko/20100401 MRA 5.6 (build 03278) Firefox/3.6.3 (.NET CLR 3.5.30729) YB/5.0.3");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_COOKIE, 'ys=gpauto.51_7681540:55_0969370:100000:1:1290013730; yandexuid=97484541291013742; t=p');
curl_setopt($ch, CURLOPT_COOKIE, 'yandexuid=728411255673025; fuid01=4b686bae0001b439.iVFr6QQnsru2vNH3uHCeBoefuyZd3ecpVwtTcZSs5tfN_qVkcexljnnZlBNx4UC2ETGPUGRAw762Ty2G-CZ24ZKsSZuNbjOj0OSwpWYosOEfE_QjnR8Avc1L09vhq0aE; yandex_login=andry-krp; yabs-frequency=/3/_Phi0Ey4Hm000j4300de12wLEjW0qmGy00011hxO0Bm4BW9ytG2N15m00080//fG8x0HI00Oa1XG80; Session_id=1289839001.-474.1.26538264.2:64554934:370.8:1277618784433:1598999664:20.71093.3605.1143791bcf79a757b4c136c1403e0002');
$html = curl_exec($ch);
curl_close($ch);
preg_match_all("!(<ashref="?cmd=words.*">(.*)</a>|<tdsalign="right">(.*)</td>)!Usi", $html, $return);
$parse_output = 0;
echo "<table border='1'><tr><td><b>word</b></td><td><b>count</b></td></tr>";
for($i = 0; $i < count($return[1]); $i++) {
// if(!preg_match("/.*$query.*/", strip_tags($return[1][$i])))
if(preg_match("/^[0-9]+$/", strip_tags($return[1][$i])))
$parse_output = 1;
if($parse_output == 0) {
echo "<tr><td>".strip_tags($return[1][$i])."</td>";
$i++;
echo "<td>".strip_tags($return[1][$i])."</td></tr>";
}
}
echo "</table>";
}
echo wordstat($_POST['query']);
?>
http://www.denwer.ru/dis/?url=PHP5/Denwer3_PHP5_2010-11-07_php5.3.1.exe&confirm=848720f981e7327dab9d71d2bf39e000
Revise this Paste
Parent: 25004