浏览器老师出现msn中国_MSN实时搜索结果收集器

浏览器老师出现msn中国

Within the last month, I've created two popular SEO tools: Google Grabber and Yahoo Grabber. Each grabber goes to the respective website and retrieves the number of pages a specified domain has indexed in the search engine. Having the indexed number of pages so quickly and easily is invaluable and a great sales tool.

在上个月内,我创建了两个流行的SEO工具: Google GrabberYahoo Grabber 。 每个抓取器都前往各自的网站,并检索指定域在搜索引擎中已编制索引的页面数。 如此快速,轻松地编制索引页面数是无价的,并且是一种出色的销售工具。

Though MSN Live Search isn't a powerhouse search engine / portal, I thought I'd throw in the effort to put one together for Microsoft's search engine.

尽管MSN Live Search并不是强大的搜索引擎/门户,但我认为我会尽全力为Microsoft的搜索引擎整合一个。

PHP代码 (The PHP Code)

/* return result number */
function get_msn_results($domain = 'davidwalsh.name')
{
	// get the result content
	$content = file_get_contents('http://search.msn.com/results.aspx?q=site%3A'.$domain);

	// parse to get results
	$pages = get_match('/id="count">(.*)</span>/isU',$content);

	//explode, get rid of "of"
	$pages = explode('of ',$pages);

	$return['pages'] = $pages[1] ? $pages[1] : 0;

	// return result
	return $return;
}

/* helper: does the regex */
function get_match($regex,$content)
{
	preg_match($regex,$content,$matches);
	return $matches[1];
}

用法 (The Usage)

$domains = array('davidwalsh.name','digg.com','msn.com','cnn.com','dzone.com','some-domain-that-doesnt-exist.com');
foreach($domains as $domain)
{
	$result = get_msn_results($domain);
	echo $domain,': ',$result['pages'],'<br />';
}

//davidwalsh.name: 431
//digg.com: 9,610,000
//msn.com: 28,100,000
//cnn.com: 17,100,000
//dzone.com: 138,000
//some-domain-that-doesnt-exist.com: 0

翻译自: https://davidwalsh.name/msn-live-search-result-grabber

浏览器老师出现msn中国

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值