雅虎索引页面脚本

发布于 2024-12-08 21:22:27 字数 951 浏览 1 评论 0原文

我正在使用以下脚本:

<?php

$domain_name = 'davidwinstead.com';
$domain_name = strtolower(trim($domain_name));

$yahoo_url = 'http://siteexplorer.search.yahoo.com/search?p=http%3A%2F%2F'.$domain_name;

$yahoo_url_contents = get_yahoo_contents($yahoo_url);

if(preg_match('/Pages \(([0-9,]{1,})\)/im', $yahoo_url_contents, $regs)){
    $indexed_pages = trim($regs[1]);
    echo ucwords($domain_name).' Has <u>'.$indexed_pages.'</u> Pages Indexed @ Yahoo.com';
}else{
    echo ucwords($domain_name).' Has Not Been Indexed @ Yahoo.com!';
}

function get_yahoo_contents($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}

?>

但似乎没有任何工作

有人有任何工作脚本吗? 谢谢

I'm using following script:

<?php

$domain_name = 'davidwinstead.com';
$domain_name = strtolower(trim($domain_name));

$yahoo_url = 'http://siteexplorer.search.yahoo.com/search?p=http%3A%2F%2F'.$domain_name;

$yahoo_url_contents = get_yahoo_contents($yahoo_url);

if(preg_match('/Pages \(([0-9,]{1,})\)/im', $yahoo_url_contents, $regs)){
    $indexed_pages = trim($regs[1]);
    echo ucwords($domain_name).' Has <u>'.$indexed_pages.'</u> Pages Indexed @ Yahoo.com';
}else{
    echo ucwords($domain_name).' Has Not Been Indexed @ Yahoo.com!';
}

function get_yahoo_contents($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}

?>

but appear don't working

anyone have any working script?
thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清晰传感 2024-12-15 21:22:27
<?php 
$domain_name = 'davidwinstead.com';
$domain_name = strtolower(trim($domain_name));
$yahoo_url = 'http://siteexplorer.search.yahoo.com/search?p=http%3A%2F%2F'.$domain_name;
$yahoo_url_contents = file_get_contents($yahoo_url);
if(preg_match('/Pages \(([0-9,]{1,})\)/im', $yahoo_url_contents, $regs)){
    $indexed_pages = trim($regs[1]);
    echo ucwords($domain_name).' Has <u>'.$indexed_pages.'</u> Pages Indexed @ Yahoo.com';
}else{
    echo ucwords($domain_name).' Has Not Been Indexed @ Yahoo.com!';
} ?>
<?php 
$domain_name = 'davidwinstead.com';
$domain_name = strtolower(trim($domain_name));
$yahoo_url = 'http://siteexplorer.search.yahoo.com/search?p=http%3A%2F%2F'.$domain_name;
$yahoo_url_contents = file_get_contents($yahoo_url);
if(preg_match('/Pages \(([0-9,]{1,})\)/im', $yahoo_url_contents, $regs)){
    $indexed_pages = trim($regs[1]);
    echo ucwords($domain_name).' Has <u>'.$indexed_pages.'</u> Pages Indexed @ Yahoo.com';
}else{
    echo ucwords($domain_name).' Has Not Been Indexed @ Yahoo.com!';
} ?>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文