<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>简单生活 —— Kevin Yang的博客 &#187; 搜索引擎</title> <atom:link href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e/feed" rel="self" type="application/rss+xml" /><link>http://www.imkevinyang.com</link> <description>It&#039;s all about sharing</description> <lastBuildDate>Mon, 06 Sep 2010 08:00:00 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO)</title><link>http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html</link> <comments>http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html#comments</comments> <pubDate>Mon, 03 May 2010 16:37:42 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[Silverlight]]></category> <category><![CDATA[RIA]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[Silverlight SEO]]></category> <category><![CDATA[Sitemap]]></category> <category><![CDATA[优化]]></category> <category><![CDATA[搜索引擎]]></category> <category><![CDATA[深层链接]]></category> <category><![CDATA[网站地图]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html</guid> <description><![CDATA[继续我们的系列文章，接着来看一下Silverlight和SEO。互联网上大部分流量都是搜索驱动的。搜索引擎通常是很多用户在公共互联网上的第一站，企业环境上的情况也在朝这个趋势发展。搜索也是很多广告获得收益的关键因素。所以无须多讲，SEO非常重要。但对于Silverlight程序来说，很多有意思的内容都是动态生成的，怎么做SEO呢？接下来我会给大家展示一个只需耗费最小工作的应用模式来实现Silverlight应用程序的SEO优化。]]></description> <content:encoded><![CDATA[<div class="statement"><p>作者：Brad Abrams</p><p>译者：Kevin Yang</p><p>英文链接：<a title="Silverlight 4 + RIA Services - Ready for Business: Search Engine Optimization (SEO)" href="http://blogs.msdn.com/brada/archive/2010/03/17/silverlight-4-ria-services-ready-for-business-search-engine-optimization-seo.aspx" target="_blank">Silverlight 4 + RIA Services - Ready for Business: Search Engine Optimization (SEO)</a></p></div><p>继续我们的系列文章，接着来看一下Silverlight和SEO。互联网上大部分流量都是搜索驱动的。搜索引擎通常是很多用户在公共互联网上的第一站，企业环境上的情况也在朝这个趋势发展。搜索也是很多广告获得收益的关键因素。所以无须多讲，SEO非常重要。但对于Silverlight程序来说，很多有意思的内容都是动态生成的，怎么做SEO呢？接下来我会给大家展示一个只需耗费最小工作的应用模式来实现Silverlight应用程序的SEO优化。</p><p>要实现Silverlight应用程序的SEO优化，需要按照以下三个有趣而又简单的步骤来实施：</p><ul><li>步骤1：做好重要的页面的深层链接</li><li>步骤2：使用网站地图(Sitemap)让搜索引擎知道你网站的所有深层链接</li><li>步骤3：对于重要内容，提供一个备选版本</li></ul><p>下面我会用例子来讲解以上这三个步骤的具体含义。我会继续沿用我在PDC209上的“美食浏览器”的演示。你可能需要看一下我之前的演示(<a href="http://blogs.msdn.com/brada/archive/2009/11/19/pdc09-talk-building-amazing-business-applications-with-silverlight-4-ria-services-and-visual-studio-2010.aspx">PDC09 Talk: Building Amazing Business Applications with Silverlight 4, RIA Services and Visual Studio 2010</a>)，这样可以在正式开始下面的讲解之前，能够熟悉一些背景。</p><p><a href="http://brad_abrams.members.winisp.net/Projects/Mix10/MyApp.SEO.zip">下载完整的示例</a>。</p><h2>步骤1: 做好重要的页面的深层链接</h2><p>对于你网站上的任何内容，如果你想让搜索引擎能够爬取到，那么必须给这份内容起一个独特的Url。例如如果我想在Bing（或者Google，或者其他搜索引擎）上搜索“乡村炸牛排（Country Fried Steak）”，能看到我网站上这个列举了很多乡村炸牛排图片的页面，那么我需要为这个页面提供一个Url，从而引导你来到这个页面。http://foo.com/foodieExplorer.aspx这个Url还不够好，我需要提供一个类似于http://foo.com/foodieExplorer.aspx?food=CountryFriedsteak这样的Url。注意，使用这种格式的Url还有很多其他的好处，例如用户可以在Twitter上传播，通过电子邮件或者即时通讯软件去讨论这些内容。</p><p>幸运的是，Silverlight的导航特性使到实现内容的深层链接变得非常简单。我们来看看具体是怎么做的。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0016.png"><img style="display: inline; border-width: 0px;" title="clip_image001[6]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0016_thumb.png" border="0" alt="clip_image001[6]" width="275" height="212" /></a></p><p>我们首先需要做的就是提供一个Url来唯一标识一个特定的餐馆，或者一个特定的餐馆加特定的美食。出于SEO或者用户友好的角度考虑，我们希望Url的格式类似于http://www.hanselman.com/abrams/restaurant/25/plate/4，这表示餐馆编号=25，美食编号=4。要实现这个，我们需要在Web工程的global.aspx文件中定义导航路径（Routes）。</p><pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> Global : HttpApplication
{
    <span class="kwrd">void</span> Application_Start(<span class="kwrd">object</span> sender, EventArgs e)
    {
        RegisterRoutes(RouteTable.Routes);
    }

    <span class="kwrd">void</span> RegisterRoutes(RouteCollection routes)
    {
        routes.MapPageRoute(
            <span class="str">"deepLinkRouteFull"</span>,
            <span class="str">"restaurant/{restaurantId}/plate/{plateId}"</span>,
            <span class="str">"~/default.aspx"</span>,
            <span class="kwrd">false</span>,
            <span class="kwrd">new</span> RouteValueDictionary { { <span class="str">"restaurant"</span>, <span class="str">"-1"</span> },
            { <span class="str">"plate"</span>, <span class="str">"-1"</span> } });

        routes.MapPageRoute(
            <span class="str">"deepLinkRoute"</span>,
            <span class="str">"restaurant/{restaurantId}"</span>,
            <span class="str">"~/default.aspx"</span>,
            <span class="kwrd">false</span>,
            <span class="kwrd">new</span> RouteValueDictionary { { <span class="str">"restaurant"</span>, <span class="str">"-1"</span> } });</pre><p>在上面代码中，我们定义了深层链接的Url模板，支持Url中添加餐馆编号（restaurantId）和美食编号（plateId）的参数。我们定义的导航路径的顺序是从最复杂到不那么复杂。如果这两个编号在Url中都缺失的话，那么将使用上面设置的默认值。</p><p>现在，我们来看看Silverlight客户端怎么解析这个Url的。在Plates.xaml.cs文件中：</p><pre class="csharpcode"><span class="rem">// Executes when the user navigates to this page.</span>
<span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> OnNavigatedTo(NavigationEventArgs e)
{
    <span class="kwrd">int</span> plateID = -1;
    <span class="kwrd">int</span> restaurantId  =-1;
    var s = HtmlPage.Document.DocumentUri.ToString().Split(<span class="kwrd">new</span> <span class="kwrd">char</span>[] {<span class="str">'/'</span>,<span class="str">'#'</span>});
    <span class="kwrd">int</span> i = Find(s, <span class="str">"plate"</span>);
    <span class="kwrd">if</span> (i != -1)
    {
         plateID = Convert.ToInt32(s[i + 1]);
         plateDomainDataSource.FilterDescriptors.Add(
             <span class="kwrd">new</span> FilterDescriptor(<span class="str">"ID"</span>,
                 FilterOperator.IsEqualTo, plateID));
    }
    i = Find(s, <span class="str">"restaurant"</span>);
    <span class="kwrd">if</span> (i != -1) restaurantId = Convert.ToInt32(s[i + 1]);
    <span class="kwrd">else</span> restaurantId = Convert.ToInt32(NavigationContext.QueryString[<span class="str">"restaurantId"</span>]);
    plateDomainDataSource.QueryParameters.Add(
        <span class="kwrd">new</span> Parameter()
        {
           ParameterName = <span class="str">"resId"</span>,
           Value = restaurantId
        }
    );
}</pre><p>基本上，上面代码所做的事情就是获取完整的Url，然后将其结构化，再提取出其中的餐馆编号和美食编号。在18-23行中，我们将餐馆编号作为参数传给查询方法，但是在11-14行中，我们并没有这么干，而是应用了一个过滤器，这就相当于最终发给服务器的LINQ查询就多了一个“where”子句。这样，我们就无需修改服务端的代码了。</p><p>我们还需要做一点小工作，那就是保证客户端最终导航到美食（Plates）的页面。这在Silverlight的导航框架中是通过锚点“#/Plates”来实现的。但由于锚点只是一个客户端特性，而搜索引擎并不能很好的处理锚点，因此我们需要在客户端动态添加锚点。我发现用一点点Javascript脚本就可以很好的完成这个工作。我在服务端的Default.aspx页面上加入了这段脚本：</p><pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">void</span> Page_Init(<span class="kwrd">object</span> sender, EventArgs e)
{
    <span class="kwrd">string</span> resId = Page.RouteData.Values[<span class="str">"restaurant"</span>] <span class="kwrd">as</span> <span class="kwrd">string</span>;
    <span class="kwrd">if</span> (resId != <span class="kwrd">null</span>) { Response.Write(<span class="str">"&lt;script type=text/javascript&gt;window.location.hash='#/Plates';&lt;/script"</span>+<span class="str">"&gt;"</span>); }
}</pre><p>还有一个小事情需要注意的，由于我们启用了路径导航的功能，现在就可以通过不同的Url来访问default.aspx页面了，因此如果使用相对路径去引用Silverlight.js以及MyApp.xap包的时候就会出现问题。例如我们会看到浏览器去请求http://www.hanselman.com/abrams/restaurant/25/plate/4/Silverlight.js，而不是http://www.hanselman.com/abrams/silverlight.js，这会导致下面错误：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0018.png"><img style="display: inline; border-width: 0px;" title="clip_image001[8]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0018_thumb.png" border="0" alt="clip_image001[8]" width="244" height="169" /></a></p><blockquote><p>行: 56</p><p>错误: Unhandled Error in Silverlight Application</p><p>异常代码: 2104</p><p>类别: InitializeError</p><p>消息: 无法下载Silverlight程序，请检查Web服务器的设置</p></blockquote><p>要解决这个问题，我们需要修改脚本的src属性：</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">script </span><span class="attr">src</span><span class="kwrd">='&lt;%= this.ResolveUrl("~/Silverlight.js") %&gt;'</span></pre><p>还有Silverlight插件参数：</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">param</span> <span class="attr">name</span><span class="kwrd">="source"</span> <span class="attr">value</span><span class="kwrd">="&lt;%= this.ResolveUrl("</span>~/<span class="attr">ClientBin</span>/<span class="attr">MyApp</span>.<span class="attr">xap</span><span class="kwrd">") %&gt;"</span><span class="kwrd">/&gt;</span></pre><p>现在我们再通过http://localhost:30045/restaurant/48/plate/119#/Plates这个包含美食编号的Url来访问，就能直接来到相应的美食页面了：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00110.png"><img style="display: inline; border-width: 0px;" title="clip_image001[10]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00110_thumb.png" border="0" alt="clip_image001[10]" width="408" height="322" /></a></p><h2>步骤2：使用网站地图让搜索引擎知道你网站的所有深层链接</h2><p>现在我们有了一个已经做好深层链接的应用程序了，每一个有趣的内容都被赋予了一个唯一的Url。但搜索引擎怎么知道这些Url呢？我们当然希望别人在社交网络上多谈论（谈论的时候通常会留下链接），然后搜索引擎能够发现其中的一部分Url，但我们更希望能够把这事做完整了。我们想给搜索引擎提供一个应用程序内部所有深层链接的Url列表。这可以使用网站地图（Sitemap）来实现。</p><p>网站地图的格式是所有主流搜索引擎都认可的。你可以在<a href="http://sitemap.org">http://sitemap.org</a>网站找到相关的信息。</p><p>为了更好的了解这其中的原理，我们来看看亚马逊，<a href="http://amazon.com">http://amazon.com</a>，这个以数据驱动的网站是如何被搜索引擎索引的。当搜索引擎第一次来到这个网站，它会去读取网站根目录下的robots.txt文件。在这个例子中，robots.txt文件的绝对地址是<a href="http://www.amazon.com/robots.txt">http://www.amazon.com/robots.txt</a>。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00112.png"><img style="display: inline; border-width: 0px;" title="clip_image001[12]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00112_thumb.png" border="0" alt="clip_image001[12]" width="222" height="341" /></a></p><p>在这个例子中，我们可以看到，文件上半部分列举了一些目录，这些目录是不允许搜索引擎爬取的，文件下半部分列举的sitemap清单，是希望搜索引擎去爬取这些网站内容。</p><p>注意，严格来说，你不是必须使用Robots文件来声明你的网站地图（译者注：原文写的是“你不是必须使用网站地图”）。你可以使用主流搜索引擎提供的网站管理员工具直接登记网站地图地址。</p><p>如果我们导航到上面其中一个网址，我们将看到一个网站地图文件，如下面所示：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00114.png"><img style="display: inline; border-width: 0px;" title="clip_image001[14]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00114_thumb.png" border="0" alt="clip_image001[14]" width="244" height="190" /></a></p><p>在这个例子中，因为亚马逊网站很庞大，这些链接被放到多个网站地图中去了（上面这个文件被称为网站地图索引文件）。当我们钻进子网站地图文件中，就能看到实际产品的链接了。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00116.png"><img style="display: inline; border-width: 0px;" title="clip_image001[16]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00116_thumb.png" border="0" alt="clip_image001[16]" width="396" height="293" /></a></p><p>格式就如你看到的：</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">urlset</span> <span class="attr">xmlns</span><span class="kwrd">="http://www.google.com/schemas/sitemap/0.84"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">url</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">loc</span><span class="kwrd">&gt;</span>http://www.amazon.com/GAITHER-COMMITTEE-EISENHOWER-COLD-WAR/dp/081425005X<span class="kwrd">&lt;/</span><span class="html">loc</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">url</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">url</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">loc</span><span class="kwrd">&gt;</span>http://www.amazon.com/CONTROLLING-VICE-REGULATING-PROSTITUTION-CRIMINAL/dp/0814250076<span class="kwrd">&lt;/</span><span class="html">loc</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">url</span><span class="kwrd">&gt;</span></pre><p>有意思的是，当亚马逊产品目录中添加或者移除商品的时候，这里的链接也会经常发生变更。</p><p>我们接着来看看如何为我们的网站建立一个网站地图。在Web工程中，打开VS的添加条目对话框，往我们工程添加一个“Search sitemap”  。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image002.png"><img style="display: inline; border-width: 0px;" title="clip_image002" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image002_thumb.png" border="0" alt="clip_image002" width="366" height="247" /></a></p><p>确认你机器上已经安装了<a href="http://silverlight.net/riaservices">RIA Services Toolkit</a> ，否则是没有这个条目模板的。</p><p>添加成功之后，我们会得到一个robots.txt文件：</p><blockquote><p># This file provides hints and instructions to search engine crawlers.</p><p># For more information, see <a href="http://www.robotstxt.org/">http://www.robotstxt.org/</a>.</p><p># Allow all</p><p>User-agent: *</p><p># Prevent crawlers from indexing static resources (images, XAPs, etc)</p><p>Disallow: /ClientBin/</p><p># Register your sitemap(s) here.</p><p>Sitemap: /Sitemap.aspx</p></blockquote><p>还有一个sitemap.aspx的文件。</p><p>更多信息，请参考：<a href="http://www.bing.com/community/blogs/webmaster/archive/2009/08/15/uncovering-web-based-treasure-with-sitemaps-sem-101.aspx">Uncovering web-based treasure with Sitemaps</a>。</p><p>但这个sitemap.aspx文件还是空的，要建立实际可用的网站地图，我们需要基于PlateViewDomainService创建另外的视图。在这个例子，这个视图的消费者是一个Asp.Net页面。这里我们要用到asp:DomainDataSource。在设计器拖放一个Repeater控件到表单中，如下所示：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image003.png"><img style="display: inline; border-width: 0px;" title="clip_image003" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image003_thumb.png" border="0" alt="clip_image003" width="244" height="157" /></a></p><p>在Repeater控件上右键配置数据源：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image004.png"><img style="display: inline; border-width: 0px;" title="clip_image004" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image004_thumb.png" border="0" alt="clip_image004" width="436" height="117" /></a></p><p>选择一个数据源</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image005.png"><img style="display: inline; border-width: 0px;" title="clip_image005" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image005_thumb.png" border="0" alt="clip_image005" width="369" height="294" /></a></p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image006.png"><img style="display: inline; border-width: 0px;" title="clip_image006" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image006_thumb.png" border="0" alt="clip_image006" width="244" height="192" /></a></p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image007.png"><img style="display: inline; border-width: 0px;" title="clip_image007" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image007_thumb.png" border="0" alt="clip_image007" width="244" height="192" /></a></p><p>最后，我们的网站地图文件中就会得到两个链接集合。</p><pre class="csharpcode"> <span class="kwrd">&lt;</span><span class="html">asp:DomainDataSource</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ID</span><span class="kwrd">="RestaurauntSitemapDataSource"</span>
 <span class="attr">DomainServiceTypeName</span><span class="kwrd">="MyApp.Web.DishViewDomainService"</span>
 <span class="attr">QueryName</span><span class="kwrd">="GetRestaurants"</span> <span class="kwrd">/&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">asp:Repeater</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">id</span><span class="kwrd">="repeater"</span> <span class="attr">DataSourceID</span><span class="kwrd">="RestaurauntSitemapDataSource"</span> <span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">HeaderTemplate</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">urlset</span> <span class="attr">xmlns</span><span class="kwrd">="http://www.sitemaps.org/schemas/sitemap/0.9"</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">HeaderTemplate</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">url</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">loc</span><span class="kwrd">&gt;</span><span class="asp">&lt;%</span>= Request.Url.AbsoluteUri.ToLower().Replace(<span class="str">"sitemap.aspx"</span>,<span class="kwrd">string</span>.Empty) + <span class="str">"restaurant/"</span><span class="asp">%&gt;</span><span class="asp">&lt;%</span># HttpUtility.UrlEncode(Eval(<span class="str">"ID"</span>).ToString()) <span class="asp">%&gt;</span><span class="kwrd">&lt;/</span><span class="html">loc</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">url</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">asp:Repeater</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">asp:DomainDataSource</span> <span class="attr">ID</span><span class="kwrd">="PlatesSitemapDataSource"</span> <span class="attr">runat</span><span class="kwrd">="server"</span>
 <span class="attr">DomainServiceTypeName</span><span class="kwrd">="MyApp.Web.DishViewDomainService"</span>
 <span class="attr">QueryName</span><span class="kwrd">="GetPlates"</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">asp:DomainDataSource</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">asp:Repeater</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">id</span><span class="kwrd">="repeater2"</span> <span class="attr">DataSourceID</span><span class="kwrd">="PlatesSitemapDataSource"</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">url</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">loc</span><span class="kwrd">&gt;</span><span class="asp">&lt;%</span>= Request.Url.AbsoluteUri.ToLower().Replace(<span class="str">"sitemap.aspx"</span>,<span class="kwrd">string</span>.Empty) + <span class="str">"restaurant/"</span><span class="asp">%&gt;</span><span class="asp">&lt;%</span># HttpUtility.UrlEncode(Eval(<span class="str">"RestaurantID"</span>).ToString()) + <span class="str">"/plate/"</span> + HttpUtility.UrlEncode(Eval(<span class="str">"ID"</span>).ToString()) <span class="asp">%&gt;</span><span class="kwrd">&lt;/</span><span class="html">loc</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">url</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;</span><span class="html">FooterTemplate</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">urlset</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">FooterTemplate</span><span class="kwrd">&gt;</span>
 <span class="kwrd">&lt;/</span><span class="html">asp:Repeater</span><span class="kwrd">&gt;</span></pre><p>在第3行和第20行，我们是直接调用在DomainService中定义的GetRestaurant 和GetPlates方法。</p><p>现在，对于一个具有相当规模数据量的网站来说，这个页面将会耗费很长的时间去执行。它需要扫描数据库中的每一行。这当然可以保证数据永远最新的，但是我们希望平衡一下服务器的负载。一个简单的做法就是通过设置一个小时的输出缓存。具体操作参考<a href="http://msdn.microsoft.com/en-us/library/aa478965.aspx">ASP.NET Caching: Techniques and Best Practices</a>。</p><pre class="csharpcode"><span class="asp">&lt;%@ OutputCache Duration="3600" VaryByParam="None" %&gt;</span></pre><p>另外一个处理这种大数据集的策略是将数据分割到多个网站地图中去，就像我们上面看到的亚马逊网站的例子。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image008.png"><img style="display: inline; border-width: 0px;" title="clip_image008" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image008_thumb.png" border="0" alt="clip_image008" width="311" height="372" /></a></p><p>随便取其中的一个Url，导航到此网址，OK，现在我们得到正确的页面了。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image009.png"><img style="display: inline; border-width: 0px;" title="clip_image009" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image009_thumb.png" border="0" alt="clip_image009" width="444" height="261" /></a></p><h2>步骤3：对于重要内容，提供一个备选版本</h2><p>太棒了，现在我们有了深层链接，我们也能让搜索引擎发现所有这些链接，不过，当搜索引擎来到这个页面的时候，它会看到什么？多数搜索引擎只会解析HTML，所以通过菜单"页面&gt;查看源代码"，我们就能够看到搜索引擎眼中我们页面的面目了:</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00118.png"><img style="display: inline; border-width: 0px;" title="clip_image001[18]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00118_thumb.png" border="0" alt="clip_image001[18]" width="358" height="207" /></a></p><p>或者我们在禁用Silverlight插件（工具 &gt; 管理加载项）后去访问此页面，我们会看到：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00120.png"><img style="display: inline; border-width: 0px;" title="clip_image001[20]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image00120_thumb.png" border="0" alt="clip_image001[20]" width="275" height="158" /></a></p><p>我们会看到一个巨大的白屏！</p><p>Silverlight生成的动态内容根本没有显示。事实上，要显示这些动态内容，必须得执行Silverlight代码。但我敢肯定，搜索引擎在任何时候都不会在他们的数据中心上去执行我们的Silverlight（或者Flash或者Ajax）代码的。所以我们需要的是一些备选的内容。</p><p>幸运的是，要做到这一点非常简单。首先让所有备选的内容展示出来。需要特别注意的是，这些内容并不单单是给搜索引擎看。制作只给搜索引擎看的内容是“糊弄搜索引擎”，或者是垃圾网页。这些内容通常用来迷惑搜索引擎，掩盖网站的真实内容（<a href="http://www.bing.com/community/blogs/webmaster/archive/2010/02/11/the-pernicious-perfidy-of-page-level-web-spam-sem-101.aspx">the pernicious perfidy of page-level web spam</a>) 。而这里的备选内容是给那些没有安装Silverlight插件的用户看的。它可能不拥有所有Silverlight的特性，但却提供了一个降级的用户体验。当搜索引擎蜘蛛没有安装Silverlight插件的时候也是如此，这可以保证它们能够索引到一些有意义而且准确的信息。</p><p>把下面这段HTML代码添加到default.aspx页面中。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="AlternativeContent"</span> <span class="attr">style</span><span class="kwrd">="display: none;"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">h2</span><span class="kwrd">&gt;</span>Hi, this is my alternative content<span class="kwrd">&lt;/</span><span class="html">h2</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span></pre><p>注意，这里写的是display:none，意味着我们并不期望浏览器去渲染这段内容...除非Silverlight插件不可用。为了实现这个效果，把下面这小段JS代码添加到页面中：</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&gt;</span>
<span class="kwrd">if</span> (!isSilverlightInstalled()) {
<span class="kwrd">var</span> obj = document.getElementById(<span class="str">'AlternativeContent'</span>);
obj.style.display = <span class="str">""</span>;
}
<span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span></pre><p>注意，这个很方便的isSilverlightInsalled函数是从Petr的<a href="http://blogs.msdn.com/piotrp/archive/2008/05/07/determining-if-silverlight-is-installed-using-javascript.aspx">old-but-good post on the subject</a>文章中找到的。我只是把这个函数添加到我的Silverlight.js文件而已。</p><pre class="csharpcode"><span class="kwrd">function</span> isSilverlightInstalled() {
    <span class="kwrd">var</span> isSilverlightInstalled = <span class="kwrd">false</span>;
    <span class="kwrd">try</span> {
        <span class="rem">//check on IE</span>
        <span class="kwrd">try</span> {
            <span class="kwrd">var</span> slControl = <span class="kwrd">new</span> ActiveXObject(<span class="str">'AgControl.AgControl'</span>);
            isSilverlightInstalled = <span class="kwrd">true</span>;
        }
        <span class="kwrd">catch</span> (e) {
            <span class="rem">//either not installed or not IE. Check Firefox</span>
            <span class="kwrd">if</span> (navigator.plugins[<span class="str">"Silverlight Plug-In"</span>]) {
                isSilverlightInstalled = <span class="kwrd">true</span>;
            }
        }
    }
    <span class="kwrd">catch</span> (e) {
        <span class="rem">//we don't want to leak exceptions. However, you may </span>
        <span class="rem">//to add exception tracking code here</span>
    }
    <span class="kwrd">return</span> isSilverlightInstalled;
}</pre><p>当我们使用一个没有启用Silverlight插件的浏览器中去浏览此页面的时候，我们就会看到备选的内容：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0025.png"><img style="display: inline; border-width: 0px;" title="clip_image002[5]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0025_thumb.png" border="0" alt="clip_image002[5]" width="244" height="134" /></a></p><p>但是如果安装了Silverlight，我们则会看到漂亮的Silverlight应用程序内容：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0035.png"><img style="display: inline; border-width: 0px;" title="clip_image003[5]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0035_thumb.png" border="0" alt="clip_image003[5]" width="244" height="184" /></a></p><p>这很不错，但我们怎么让页面显示正确的内容呢？我们想要展示和Silverlight应用程序完全一致的数据，而且又不想写太多代码。我们也实在不想去维护太多页面。所以让我们在页面的AlternativeContent这个DIV里头加入一些基本的代码。这个ListView是用来显示餐馆详细信息的。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">asp:ListView</span> <span class="attr">ID</span><span class="kwrd">="RestaurnatDetails"</span> <span class="attr">runat</span><span class="kwrd">="server"</span>
                <span class="attr">EnableViewState</span><span class="kwrd">="false"</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">LayoutTemplate</span><span class="kwrd">&gt;</span>
       <span class="kwrd">&lt;</span><span class="html">asp:PlaceHolder</span> <span class="attr">ID</span><span class="kwrd">="ItemPlaceHolder"</span> <span class="attr">runat</span><span class="kwrd">="server"</span><span class="kwrd">/&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">LayoutTemplate</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
       <span class="kwrd">&lt;</span><span class="html">asp:DynamicEntity</span> <span class="attr">ID</span><span class="kwrd">="RestaurnatEntity"</span> <span class="attr">runat</span><span class="kwrd">="server"</span><span class="kwrd">/&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">asp:ListView</span><span class="kwrd">&gt;</span></pre><p>现在我们需要把它和我们的数据源绑定...我发现在VS的设计视图里头很容易就能够做到这一点。注意，要在设计器中编辑这个DIV，你需要将DIV改成可见模式。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0045.png"><img style="display: inline; border-width: 0px;" title="clip_image004[5]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0045_thumb.png" border="0" alt="clip_image004[5]" width="244" height="130" /></a></p><p>然后我们来配置一下数据源：</p><p><a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image70.png"><img style="display: inline; border-width: 0px;" title="clip_image005[5]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0055.png" border="0" alt="clip_image005[5]" width="270" height="212" /></a></p><p>下一步，我们需要基于我们之前定义的导航路径来绑定查询参数。</p><p><a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_74.png"><img style="display: inline; border-width: 0px;" title="clip_image006[5]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0065.png" border="0" alt="clip_image006[5]" width="275" height="192" /></a></p><p>然后，我们对美食的ListView控件也重复同样的操作...</p><p>现在我们得到的代码非常简单:</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">asp:ListView</span> <span class="attr">ID</span><span class="kwrd">="RestaurnatDetails"</span> <span class="attr">runat</span><span class="kwrd">="server"</span>
         <span class="attr">EnableViewState</span><span class="kwrd">="false"</span> <span class="attr">DataSourceID</span><span class="kwrd">="restaurantsDomainDataSource"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">LayoutTemplate</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">asp:PlaceHolder</span> <span class="attr">ID</span><span class="kwrd">="ItemPlaceHolder"</span> <span class="attr">runat</span><span class="kwrd">="server"</span><span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">LayoutTemplate</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
     <span class="kwrd">&lt;</span><span class="html">asp:DynamicEntity</span> <span class="attr">ID</span><span class="kwrd">="RestaurnatEntity"</span> <span class="attr">runat</span><span class="kwrd">="server"</span><span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">asp:ListView</span><span class="kwrd">&gt;</span>

<span class="kwrd">&lt;</span><span class="html">asp:DomainDataSource</span> <span class="attr">ID</span><span class="kwrd">="restaurantsDomainDataSource"</span> <span class="attr">runat</span><span class="kwrd">="server"</span>
               <span class="attr">DomainServiceTypeName</span><span class="kwrd">="MyApp.Web.DishViewDomainService"</span>
               <span class="attr">QueryName</span><span class="kwrd">="GetRestaurant"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">QueryParameters</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">asp:RouteParameter</span> <span class="attr">name</span><span class="kwrd">="id"</span> <span class="attr">RouteKey</span><span class="kwrd">="restaurantId"</span>
                   <span class="attr">DefaultValue</span> <span class="kwrd">="-1"</span> <span class="attr">Type</span> = <span class="kwrd">"Int32"</span><span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">QueryParameters</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">asp:DomainDataSource</span><span class="kwrd">&gt;</span></pre><p>下一步，我们需要让这些控件基于数据动态生成UI。</p><pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">void</span> Page_Init(<span class="kwrd">object</span> sender, EventArgs e)
{
 RestaurnatDetails.EnableDynamicData(<span class="kwrd">typeof</span>(MyApp.Web.Restaurant));
 PlateDetails.EnableDynamicData(<span class="kwrd">typeof</span>(MyApp.Web.Plate));
 <span class="kwrd">string</span> resId = Page.RouteData.Values[<span class="str">"restaurant"</span>] <span class="kwrd">as</span> <span class="kwrd">string</span>;
 <span class="kwrd">if</span> (resId != <span class="kwrd">null</span>) { Response.Write(<span class="str">"&lt;script type=text/javascript&gt;window.location.hash='#/Plates';&lt;/script"</span>+<span class="str">"&gt;"</span>); }
}</pre><p>注意到，我们在第4-5行处为这两个ListView控件启用了动态数据。</p><p>最后一步，我们需要添加DynamicData需要用到的模板集。你可以从任何DynamicData的工程中获得相应的文件。将其拷贝到Web工程根目录下。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0075.png"><img style="display: inline; border-width: 0px;" title="clip_image007[5]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0075_thumb.png" border="0" alt="clip_image007[5]" width="165" height="212" /></a></p><p>你可以通过编辑这些模板来控制数据的显示。</p><p>在EntityTemplates目录中，我们需要为每个实体创建一个实体模板（在这个例子中，有美食和餐馆这两个实体）。这会决定他们是如何显示的。</p><pre class="csharpcode"><span class="asp">&lt;%@ Control Language="C#" CodeBehind="Restaurant.ascx.cs" Inherits="MyApp.Web.RestaurantEntityTemplate" %&gt;</span>

<span class="kwrd">&lt;</span><span class="html">asp:DynamicControl</span>  <span class="attr">ID</span><span class="kwrd">="DynamicControl8"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">DataField</span><span class="kwrd">="ImagePath"</span> <span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;</span><span class="html">ul</span> <span class="attr">class</span><span class="kwrd">="restaurant"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">ul</span> <span class="attr">class</span><span class="kwrd">="restaurantDetails"</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;&lt;</span><span class="html">h2</span><span class="kwrd">&gt;&lt;</span><span class="html">asp:DynamicControl</span> <span class="attr">ID</span><span class="kwrd">="NameControl"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">DataField</span><span class="kwrd">="Name"</span> <span class="kwrd">/&gt;</span> <span class="kwrd">&lt;/</span><span class="html">h2</span><span class="kwrd">&gt;</span> <span class="kwrd">&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;&lt;</span><span class="html">asp:DynamicControl</span> <span class="attr">ID</span><span class="kwrd">="DynamicControl1"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">DataField</span><span class="kwrd">="ContactName"</span> <span class="kwrd">/&gt;</span> (<span class="kwrd">&lt;</span><span class="html">asp:DynamicControl</span> <span class="attr">ID</span><span class="kwrd">="DynamicControl2"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">DataField</span><span class="kwrd">="ContactTitle"</span> <span class="kwrd">/&gt;</span>)<span class="kwrd">&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;&lt;</span><span class="html">asp:DynamicControl</span> <span class="attr">ID</span><span class="kwrd">="DynamicControl3"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">DataField</span><span class="kwrd">="Address"</span> <span class="kwrd">/&gt;</span>  <span class="kwrd">&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;&lt;</span><span class="html">asp:DynamicControl</span> <span class="attr">ID</span><span class="kwrd">="DynamicControl4"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">DataField</span><span class="kwrd">="City"</span> <span class="kwrd">/&gt;</span>, <span class="kwrd">&lt;</span><span class="html">asp:DynamicControl</span> <span class="attr">ID</span><span class="kwrd">="DynamicControl5"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">DataField</span><span class="kwrd">="Region"</span> <span class="kwrd">/&gt;</span>  <span class="kwrd">&lt;</span><span class="html">asp:DynamicControl</span> <span class="attr">ID</span><span class="kwrd">="DynamicControl6"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">DataField</span><span class="kwrd">="PostalCode"</span> <span class="kwrd">/&gt;</span>  <span class="kwrd">&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;&lt;</span><span class="html">asp:DynamicControl</span> <span class="attr">ID</span><span class="kwrd">="DynamicControl7"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">DataField</span><span class="kwrd">="Phone"</span> <span class="kwrd">/&gt;</span>  <span class="kwrd">&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;&lt;</span><span class="html">asp:HyperLink</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ID</span><span class="kwrd">="link"</span>  <span class="attr">NavigateUrl</span><span class="kwrd">="&lt;%#GetDetailsUrl() %&gt;"</span> <span class="attr">Text</span><span class="kwrd">="details.."</span><span class="kwrd">&gt;&lt;/</span><span class="html">asp:HyperLink</span><span class="kwrd">&gt;&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">ul</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">ul</span><span class="kwrd">&gt;</span></pre><p>这里我们只是做了些简单的格式化操作，然后把我们需要在备选内容中显示的字段挑选出来。对美食实体也重复同样的操作…</p><p>现在我们已经可以准备运行了。</p><p>访问根目录，在没有添加任何Url参数的情况下，我们会看到一个餐馆列表，当然，全都是HTML代码。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0085.png"><img style="display: inline; border-width: 0px;" title="clip_image008[5]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0085_thumb.png" border="0" alt="clip_image008[5]" width="275" height="191" /></a></p><p>接着我们可以添加一个导航来定位某个特定餐馆的所有美食。</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0095.png"><img style="display: inline; border-width: 0px;" title="clip_image009[5]" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image0095_thumb.png" border="0" alt="clip_image009[5]" width="249" height="212" /></a></p><p>但是，让我们在真正的浏览器中浏览此页面，确保我们看到的和搜索引擎看到的是一样的。</p><p>Lynx还活着！Lynx是我92年在北卡罗来纳州州立大学Leazar实验室的DEC2100机器上用过的第一个浏览器...现在还可以正常工作！</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image010.png"><img style="display: inline; border-width: 0px;" title="clip_image010" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image010_thumb.png" border="0" alt="clip_image010" width="275" height="184" /></a></p><p>还有细节信息：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image011.png"><img style="display: inline; border-width: 0px;" title="clip_image011" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image011_thumb.png" border="0" alt="clip_image011" width="275" height="184" /></a></p><p>这款经典的文本浏览器让我们看到了纯文本模式下页面的样子，这恰恰是搜索引擎蜘蛛所看到的。</p><p>现在，来看真正的测试。</p><p>我们使用Bing去搜索“我的美食浏览器——和Joe学烹饪”，显然，这个页面确实在那。</p><p><a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_56.png"><img style="display: inline; border-width: 0px;" title="clip_image012" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image012.png" border="0" alt="clip_image012" width="275" height="185" /></a></p><p>点击这个链接？</p><p>浏览器导航到的页面正是我们期望的页面。</p><p><a href="http://blogs.msdn.com/blogfiles/brada/WindowsLiveWriter/Silverlight4RIAServicesReadyforBusinessS_C533/image_58.png"><img style="display: inline; border-width: 0px;" title="clip_image013" src="http://www.imkevinyang.com/wp-content/uploads/2010/05/clip_image013.png" border="0" alt="clip_image013" width="275" height="191" /></a></p><p>当然，这在另外一个<a href="http://www.google.com/#hl=en&amp;source=hp&amp;q=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;btnG=Google+Search&amp;aq=f&amp;aqi=&amp;aql=&amp;oq=my+foodie+Explorer+Cooking+Class+with+Joe..&amp;fp=f55f94328208dcc1" target="_blank">搜索引擎</a>来说也是一样的... 如果你刚好是另外这个搜索引擎的用户:-)</p><h2>总结</h2><p>在上面这个例子中，我们学习了如何创建一个SEO优化过的、以数据驱动的Silverlight应用程序的基本操作。总共分为三个步骤：</p><ul><li>步骤1：做好重要的页面的深层链接</li><li>步骤2：使用网站地图(Sitemap)让搜索引擎知道你网站的所有深层链接</li><li>步骤3：对于重要内容，提供一个备选版本</li></ul><p>希望你们喜欢~</p><p>更多信息，请参考:  <a href="http://www.bing.com/community/blogs/webmaster/archive/2010/03/05/illuminating-the-path-to-seo-for-silverlight.aspx">点亮Silverlight的SEO之路</a>。</p>标签：<a href="http://www.imkevinyang.com/tags/ria" title="RIA" rel="tag">RIA</a>, <a href="http://www.imkevinyang.com/tags/seo" title="SEO" rel="tag">SEO</a>, <a href="http://www.imkevinyang.com/categories/techarticles/silverlight" title="Silverlight" rel="tag">Silverlight</a>, <a href="http://www.imkevinyang.com/tags/silverlight" title="Silverlight" rel="tag">Silverlight</a>, <a href="http://www.imkevinyang.com/tags/silverlight-seo" title="Silverlight SEO" rel="tag">Silverlight SEO</a>, <a href="http://www.imkevinyang.com/tags/sitemap" title="Sitemap" rel="tag">Sitemap</a>, <a href="http://www.imkevinyang.com/tags/%e4%bc%98%e5%8c%96" title="优化" rel="tag">优化</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/tags/%e6%b7%b1%e5%b1%82%e9%93%be%e6%8e%a5" title="深层链接" rel="tag">深层链接</a>, <a href="http://www.imkevinyang.com/tags/%e7%bd%91%e7%ab%99%e5%9c%b0%e5%9b%be" title="网站地图" rel="tag">网站地图</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/09/blend%e5%b0%8f%e8%b4%b4%e5%a3%ab%e6%94%b9%e5%8f%98%e9%bc%a0%e6%a0%87%e6%bb%9a%e8%bd%ae%e7%9a%84%e9%bb%98%e8%ae%a4%e8%a1%8c%e4%b8%ba-2.html" title="Blend小贴士&mdash;&mdash;改变鼠标滚轮的默认行为 (2009/09/18)">Blend小贴士&mdash;&mdash;改变鼠标滚轮的默认行为</a> (2009/09/18)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html" title="Robots.txt文件 (2009/05/06)">Robots.txt文件</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/02/silverlight-2-rtm-%e5%a4%9a%e5%9b%bd%e8%af%ad%e8%a8%80%e6%94%af%e6%8c%81%ef%bc%88%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e6%9c%ac%e5%9c%b0%e5%8c%96%ef%bc%89.html" title="Silverlight 2 RTM 多国语言支持（应用程序本地化） (2009/02/28)">Silverlight 2 RTM 多国语言支持（应用程序本地化）</a> (2009/02/28)</li><li><a href="http://www.imkevinyang.com/2009/03/silverlight-2%e5%8a%a8%e6%80%81%e5%8a%a0%e8%bd%bdxap%e5%8c%85%e4%b8%ad%e7%9a%84%e7%a8%8b%e5%ba%8f%e9%9b%86.html" title="Silverlight 2动态加载Xap包中的程序集 (2009/03/02)">Silverlight 2动态加载Xap包中的程序集</a> (2009/03/02)</li><li><a href="http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html" title="Silverlight SEO（搜索引擎优化）白皮书 (2009/04/06)">Silverlight SEO（搜索引擎优化）白皮书</a> (2009/04/06)</li><li><a href="http://www.imkevinyang.com/2009/03/silverlight2-%e5%8a%a8%e6%80%81%e5%8a%a0%e8%bd%bd%e7%a8%8b%e5%ba%8f%e9%9b%86-ondemand%e6%a8%a1%e5%bc%8fdynamic-load-assembly.html" title="Silverlight2 动态加载程序集&#8212;OnDemand模式(Dynamic Load Assembly) (2009/03/02)">Silverlight2 动态加载程序集&#8212;OnDemand模式(Dynamic Load Assembly)</a> (2009/03/02)</li><li><a href="http://www.imkevinyang.com/2010/02/silverlight%e5%90%af%e7%94%a8assembly-caching%e4%b9%8b%e5%90%8e%e9%93%81%e9%80%9a%e7%94%a8%e6%88%b7%e6%97%a0%e6%b3%95%e8%ae%bf%e9%97%ae.html" title="Silverlight启用Assembly Caching之后铁通用户无法访问 (2010/02/13)">Silverlight启用Assembly Caching之后铁通用户无法访问</a> (2010/02/13)</li><li><a href="http://www.imkevinyang.com/2010/03/silverlight%e7%9a%84%e4%be%9d%e8%b5%96%e5%b1%9e%e6%80%a7%e4%b8%8e%e9%99%84%e5%8a%a0%e5%b1%9e%e6%80%a7.html" title="Silverlight的依赖属性与附加属性 (2010/03/28)">Silverlight的依赖属性与附加属性</a> (2010/03/28)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>在Wordpress中轻松集成Google自定义搜索引擎</title><link>http://www.imkevinyang.com/2009/12/%e5%9c%a8wordpress%e4%b8%ad%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html</link> <comments>http://www.imkevinyang.com/2009/12/%e5%9c%a8wordpress%e4%b8%ad%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html#comments</comments> <pubDate>Mon, 07 Dec 2009 06:22:00 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[工具技巧]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[博客搜索]]></category> <category><![CDATA[搜索引擎]]></category> <category><![CDATA[站内搜索]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/12/%e5%9c%a8wordpress%e4%b8%ad%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html</guid> <description><![CDATA[<p>虽然Wordpress自带有一个站内搜索引擎，但是性能比较低下，而且还会占用服务器资源。所以还不如利用Google提供的自定义搜索引擎，将其集成到我们的博客中来。</p><p>之前我博客上面已经使用了Google的自定义搜索引擎，但是当用户搜索的时候，是跳到google.com的域名上面去，而不是在我自己的域上。我希望能够将搜索结果放在我自己设计的页面上，这样的好处是风格统一，在一定程度上也降低了用户流失率。下面讲一下如何在wordpress中集成G&#8230;</p>]]></description> <content:encoded><![CDATA[<p>虽然Wordpress自带有一个站内搜索引擎，但是性能比较低下，而且还会占用服务器资源。所以还不如利用Google提供的自定义搜索引擎，将其集成到我们的博客中来。</p><p>之前我博客上面已经使用了Google的自定义搜索引擎，但是当用户搜索的时候，是跳到google.com的域名上面去，而不是在我自己的域上。我希望能够将搜索结果放在我自己设计的页面上，这样的好处是风格统一，在一定程度上也降低了用户流失率。下面讲一下如何在wordpress中集成Google自定义搜索引擎。</p><h2>第一步：注册Google自定义搜索引擎</h2><p>首先，我们需要到Google上面去注册一个自己的搜索引擎。访问<a title="http://www.google.com/cse/" href="http://www.google.com/cse/">http://www.google.com/cse/</a>，用你的Google账户登录之后，创建新的搜索引擎。</p><p><img style="display: inline; border-width: 0px;" title="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb5.png" border="0" alt="image" width="319" height="49" /></p><blockquote><p>这里需要注意，最好在英文版下操作。因为使用英文版可以提前体验一些新功能，例如一会要用到的样式设计。</p></blockquote><p>在Sites（网站）中加上自己的博客链接，这样搜索结果就限定在你设置的网站内了。注意通配符的使用。</p><p><img style="display: inline; border-width: 0px;" title="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb6.png" border="0" alt="image" width="244" height="104" /></p><p>接着点击control panel（控制面板）=&gt;get code（获取代码），这时会进入生成代码的页面。</p><p><img style="display: inline; border-width: 0px;" title="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb7.png" border="0" alt="image" width="394" height="258" /></p><p>以往Google自定义搜索的结果只能放在Google自己的域上（以弹出窗口或者iframe的形式展示），现在新增了一个自定义搜索元素的选项，通过这个选项，我们可以使用Google ajax search的API，直接在我们自己的页面上指定的div上输出搜索结果了。</p><p>点击页面上的look and feel我们还可以配置搜索结果的样式。Google预置了几套挺不错的样式供你选择。</p><p><img style="display: inline; border-width: 0px;" title="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb8.png" border="0" alt="image" width="290" height="220" /></p><p>这里我选择的是greensky的样式。</p><p>拷贝上面自动生成的javascript代码，一会要用到。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="cse"</span> <span class="attr">style</span><span class="kwrd">="width: 100%;"</span><span class="kwrd">&gt;</span>Loading<span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">src</span><span class="kwrd">="http://www.google.com/jsapi"</span> <span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&gt;&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>
&lt;script type=<span class="str">"text/javascript"</span>&gt;
  google.load(<span class="str">'search'</span>, <span class="str">'1'</span>, {language : <span class="str">'zh-CN'</span>});
  google.setOnLoadCallback(<span class="kwrd">function</span>(){
    <span class="kwrd">var</span> customSearchControl = <span class="kwrd">new</span> google.search.CustomSearchControl(<span class="str">'009527755525159401988:63iuuetccag'</span>);
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.draw(<span class="str">'cse'</span>);
  }, <span class="kwrd">true</span>);
<span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">link</span> <span class="attr">rel</span><span class="kwrd">="stylesheet"</span> <span class="attr">href</span><span class="kwrd">="http://www.google.com/cse/style/look/greensky.css"</span> <span class="attr">type</span><span class="kwrd">="text/css"</span> <span class="kwrd">/&gt;</span></pre><h2>第二步：创建搜索结果页</h2><p>为了让搜索结果在博客内显示，我们需要在wordpress中创建一个新的页面，作为搜索结果展示的页面。定位到wordpress主题文件夹下，然后新建一个叫做cse.php（文件名无所谓）的模板文件，内容如下所示，注意到，中间的一段代码就是在第一步中Google自定义搜索引擎后台获取到的代码。</p><pre class="csharpcode"><span class="kwrd">&lt;?</span><span class="html">php</span>
/*
<span class="attr">Template</span> <span class="attr">Name:</span> <span class="attr">cse</span>
*/
?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;?</span><span class="html">php</span> <span class="attr">get_header</span>(); ?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="cse"</span> <span class="attr">style</span><span class="kwrd">="width: 100%;"</span><span class="kwrd">&gt;</span>Loading<span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">src</span><span class="kwrd">="http://www.google.com/jsapi"</span> <span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&gt;&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>
&lt;script type=<span class="str">"text/javascript"</span>&gt;
  google.load(<span class="str">'search'</span>, <span class="str">'1'</span>, {language : <span class="str">'zh-CN'</span>});
  google.setOnLoadCallback(<span class="kwrd">function</span>(){
    <span class="kwrd">var</span> customSearchControl = <span class="kwrd">new</span> google.search.CustomSearchControl(<span class="str">'009527755525159401988:63iuuetccag'</span>);
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.draw(<span class="str">'cse'</span>);
  }, <span class="kwrd">true</span>);
<span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">link</span> <span class="attr">rel</span><span class="kwrd">="stylesheet"</span> <span class="attr">href</span><span class="kwrd">="http://www.google.com/cse/style/look/greensky.css"</span> <span class="attr">type</span><span class="kwrd">="text/css"</span> <span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;?</span><span class="html">php</span> <span class="attr">get_footer</span>(); ?<span class="kwrd">&gt;</span></pre><p>注意，<strong><span style="color: #008000;">上面代码中的Template Name后面填的名称，将会显示在wordpress后台文章/页面编辑器的模板选择框中</span></strong>。</p><p>将此模板文件通过FTP上传到服务器上相应的主题文件夹下，然后我们登录wordpress后台，创建一个新的页面，名字为sitesearch:</p><p><img style="display: inline; border-width: 0px;" title="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb9.png" border="0" alt="image" width="157" height="109" /></p><p>然后在右侧选择应用刚刚创建的cse模板：</p><p><img style="display: inline; border-width: 0px;" title="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb10.png" border="0" alt="image" width="244" height="124" /></p><p>OK，现在当我们访问http: //www.imkevinyang.com/sitesearch网址的时候，就可以看到Google的搜索框了。由于默认没有填入任何搜索关键词，所以我们暂时看不到任何搜索结果。</p><p><img style="display: inline; border-width: 0px;" title="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb11.png" border="0" alt="image" width="342" height="83" /></p><h2>第三步：修改站内搜索提交表单</h2><p>上面我们已经创建了一个搜索结果页了，但现在这个页面是一个孤立页面，没有和其他页面关联起来。接下来我们要做的事情，就是<strong><span style="color: #008000;">当用户点击你网站上任意页面的站内搜索按钮的时候，将用户引导到你刚刚创建的搜索结果页上</span></strong>。</p><p>在你的主题文件夹中找到相应的模板页，在模板页中找到站内搜索相关的代码，例如我使用的inove主题，站内搜索相关的代码是放在templates/header.php文件中，代码如下：</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">class</span><span class="kwrd">="searchbox"</span> <span class="attr">style</span><span class="kwrd">="padding-top:5px;"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">form</span> <span class="attr">method</span><span class="kwrd">="get"</span> <span class="attr">action</span><span class="kwrd">="/"</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">type</span><span class="kwrd">="text"</span> <span class="attr">size</span><span class="kwrd">="24"</span> <span class="attr">name</span><span class="kwrd">="q"</span> <span class="attr">value</span><span class="kwrd">="搜索文章...."</span> <span class="attr">class</span><span class="kwrd">="textfield"</span> <span class="attr">style</span><span class="kwrd">="float:left"</span> <span class="attr">onblur</span><span class="kwrd">="if (this.value == '') {this.value = '搜索文章....';}"</span> <span class="attr">onfocus</span><span class="kwrd">="if (this.value != '') {this.value = '';}"</span><span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">type</span><span class="kwrd">="hidden"</span> <span class="attr">value</span><span class="kwrd">="UTF-8"</span> <span class="attr">name</span><span class="kwrd">="ie"</span><span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">class</span><span class="kwrd">="submitSearch"</span> <span class="attr">type</span><span class="kwrd">="submit"</span> <span class="attr">value</span><span class="kwrd">="Search"</span><span class="kwrd">&gt;&lt;/</span><span class="html">input</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">form</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span></pre><p>不同主题的站内搜索代码可能很不一样，放置的位置也不一样，大家可以尝试在整个主题文件夹中搜索包含“searchbox”关键字的文件。</p><p>内置的搜索引擎当用户点击搜索按钮之后会跳转到“http: //www.imkevinyang.com/?q=关键词”这样的地址，现在我们想让搜索结果跳到sitesearch页面，也就是刚才创建的页面，因此我们将上面代码中的form表单的action属性值改成“sitesearch”，这样，当我们提交表单的时候，跳转到的Url就形如：/sitesearch?q=XXX&amp;ie=utf-8了。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">form</span> <span class="attr">method</span><span class="kwrd">="get"</span> <span class="attr">action</span><span class="kwrd">="/sitesearch"</span><span class="kwrd">&gt;</span></pre><h2>第四步：初始化搜索关键字</h2><p>好，现在当我们点击站内搜索按钮的时候，会跳到我们创建的页面/sitesearch上，并在Url参数中附带用户搜索的关键字。但是你会发现，搜索页面还是一片空白，没有展示任何搜索结果。这是因为<strong><span style="color: #008000;">Google并不能自动识别Url参数中的搜索关键字。因此我们要做的事情就是，先从Url中提取用户搜索的关键词，然后调用Google API使用此关键词进行搜索。</span></strong></p><p>打开之前创建的cse.php模板，代码修改如下：</p><pre class="csharpcode"><span class="kwrd">&lt;?</span><span class="html">php</span>
/*
<span class="attr">Template</span> <span class="attr">Name:</span> <span class="attr">cse</span>
*/
?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;?</span><span class="html">php</span> <span class="attr">get_header</span>(); ?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="cse"</span> <span class="attr">style</span><span class="kwrd">="width: 100%;"</span><span class="kwrd">&gt;</span>Loading<span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">src</span><span class="kwrd">="http://www.google.com/jsapi"</span> <span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&gt;&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>
&lt;script type=<span class="str">"text/javascript"</span>&gt;
  google.load(<span class="str">'search'</span>, <span class="str">'1'</span>, {language : <span class="str">'zh-CN'</span>});
  google.setOnLoadCallback(<span class="kwrd">function</span>(){
        <span class="kwrd">var</span> customSearchControl = <span class="kwrd">new</span> google.search.CustomSearchControl(<span class="str">'009527755525159401988:63iuuetccag'</span>);
        customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
        customSearchControl.draw(<span class="str">'cse'</span>);
        <span class="kwrd">var</span> match = location.search.match(/q=([^&amp;]*)(&amp;|$)/);
        <span class="kwrd">if</span>(match &amp;&amp; match[1]){
            <span class="kwrd">var</span> search = decodeURIComponent(match[1]);            

            customSearchControl.execute(search);
        }
    });
<span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">link</span> <span class="attr">rel</span><span class="kwrd">="stylesheet"</span> <span class="attr">href</span><span class="kwrd">="http://www.google.com/cse/style/look/greensky.css"</span> <span class="attr">type</span><span class="kwrd">="text/css"</span> <span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;?</span><span class="html">php</span> <span class="attr">get_footer</span>(); ?<span class="kwrd">&gt;</span></pre><p>在上面的代码中，我先使用正则表达式提取出来Url中的关键词，并使用UTF-8解码，然后让google执行搜索。实际使用中，你需要确认你网站上使用的Url搜索参数是不是q，如果不是，那么需要将上述的正则表达式中的q改成你自己定义的参数。</p><p>最终的效果:</p><p><img style="display: inline; border-width: 0px;" title="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb12.png" border="0" alt="image" width="349" height="182" /></p><h2>细微的调整</h2><h3>改用Google.CN防止站内搜索被重置</h3><p>由于众所周知的原因，我们使用Google.com搜索的时候经常会无厘头的被重置掉了，我们并不希望用户在我们网站上搜索文章的时候无缘无故被屏蔽掉了。所以为了保险起见，我们可以将第一步代码中引用的javascript文件地址修改成google.cn，这样所有的搜索都会使用google.cn（部分功能如adsense还是会使用google.com）。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">src</span><span class="kwrd">="http://www.google.com/jsapi"</span> <span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&gt;&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span></pre><p>修改成：</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">src</span><span class="kwrd">="http://www.google.cn/jsapi"</span> <span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&gt;&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span></pre><h3>让搜索结果只包含文章页</h3><p>大多数博客为了便于用户查阅文章，都会对文章进行聚类，例如按文章标签（也就是关键词）聚类，按文章类别聚类，按存档年份或者月份聚类，等等，这样就会出现大量冗余的内容，对搜索引擎来说，这样的聚类可以让博客看起来内容更丰富些，同时站内链接比较健康，SEO效果会相对好，但这样一来，用户就不容易在搜索结果中快速找到他想看的文章了，因此我们在设置搜索结果的时候，最好让结果只包含文章内容页即可。</p><p>要做到这一点，只需要在第一步中的“包含网站”中将原先的“*.imkevinyang.com/*”替换成“*.imkevinyang.com/*.html”即可。</p><h2>总结</h2><p>利用Google自定义搜索引擎还有很多其他的好处，例如可以和Google Analytics以及Adsense整合到一起，报表分析更加透彻。将搜索结果放置到自己博客内页，可以自己修改样式，以保持和主题风格的一致，同时也可以吸引用户留在你的博客上。</p><p>更加高级的用法，请参考<a title="Google代码指南" href="http://www.google.com/cse/docs/" target="_blank">Google代码指南</a>。</p><p>文章参考：<a href="http://www.whisperer.name/2009/09/improve-the-google-custom-search-results-of-inove/">http://www.whisperer.name/2009/09/improve-the-google-custom-search-results-of-inove/</a></p><p style="text-align: right;">——<a href="http://www.imkevinyang.com/"><em><strong>Kevin Yang</strong></em></a></p>标签：<a href="http://www.imkevinyang.com/tags/google" title="Google" rel="tag">Google</a>, <a href="http://www.imkevinyang.com/tags/wordpress" title="WordPress" rel="tag">WordPress</a>, <a href="http://www.imkevinyang.com/tags/%e5%8d%9a%e5%ae%a2%e6%90%9c%e7%b4%a2" title="博客搜索" rel="tag">博客搜索</a>, <a href="http://www.imkevinyang.com/categories/techarticles/toolskills-techarticles" title="工具技巧" rel="tag">工具技巧</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/tags/%e7%ab%99%e5%86%85%e6%90%9c%e7%b4%a2" title="站内搜索" rel="tag">站内搜索</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/08/4%e8%a1%8cgreasemonkey%e4%bb%a3%e7%a0%81%e6%9c%80%e5%a4%a7%e5%8c%96google-reader%e7%9a%84%e9%98%85%e8%af%bb%e7%a9%ba%e9%97%b4.html" title="4行Greasemonkey代码最大化Google Reader的阅读空间 (2009/08/09)">4行Greasemonkey代码最大化Google Reader的阅读空间</a> (2009/08/09)</li><li><a href="http://www.imkevinyang.com/2010/03/android%e6%89%8b%e6%9c%ba%e5%88%9d%e4%bd%93%e9%aa%8c.html" title="Android手机初体验 (2010/03/01)">Android手机初体验</a> (2010/03/01)</li><li><a href="http://www.imkevinyang.com/2010/03/g1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html" title="G1手机与笔记本实现Wifi互联共享上网 (2010/03/02)">G1手机与笔记本实现Wifi互联共享上网</a> (2010/03/02)</li><li><a href="http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html" title="Google Analytics中的UniquePageView和Visits的区别 (2009/12/07)">Google Analytics中的UniquePageView和Visits的区别</a> (2009/12/07)</li><li><a href="http://www.imkevinyang.com/2009/11/google-wave%e4%b8%ba%e4%bb%80%e4%b9%88%e8%bf%99%e4%b9%88%e7%81%ab.html" title="Google Wave为什么这么火 (2009/11/14)">Google Wave为什么这么火</a> (2009/11/14)</li><li><a href="http://www.imkevinyang.com/2009/05/google%e5%92%8c%e5%be%ae%e8%bd%af%e7%9a%84%e4%b8%80%e5%a4%a7%e4%b8%8d%e5%90%8c.html" title="Google和微软的一大不同 (2009/05/06)">Google和微软的一大不同</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e6%8e%92%e5%90%8d%e6%9b%b4%e6%96%b0.html" title="Google排名更新 (2009/03/21)">Google排名更新</a> (2009/03/21)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e7%9a%84%e4%bb%b7%e5%80%bc%e8%a7%82.html" title="Google的价值观 (2009/03/07)">Google的价值观</a> (2009/03/07)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/12/%e5%9c%a8wordpress%e4%b8%ad%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html/feed</wfw:commentRss> <slash:comments>41</slash:comments> </item> <item><title>搜索引擎到底该为谁服务</title><link>http://www.imkevinyang.com/2009/06/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%88%b0%e5%ba%95%e8%af%a5%e4%b8%ba%e8%b0%81%e6%9c%8d%e5%8a%a1.html</link> <comments>http://www.imkevinyang.com/2009/06/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%88%b0%e5%ba%95%e8%af%a5%e4%b8%ba%e8%b0%81%e6%9c%8d%e5%8a%a1.html#comments</comments> <pubDate>Fri, 26 Jun 2009 13:12:00 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[生活网事]]></category> <category><![CDATA[信息自由化]]></category> <category><![CDATA[信息过滤]]></category> <category><![CDATA[央视门]]></category> <category><![CDATA[搜索引擎]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/06/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%88%b0%e5%ba%95%e8%af%a5%e4%b8%ba%e8%b0%81%e6%9c%8d%e5%8a%a1.html</guid> <description><![CDATA[<p>这阵子发生的滤霸和央视门事件被炒得沸沸扬扬的，但凡稍微有点网龄的人观点几乎都一边倒，骂滤霸，骂工信部，骂央视，只有少数一些五毛党以及类五毛党还在不断游离于各大知名站点为他们的雇主们“拨乱反正”。</p><p>关于这两事件详情参见可能吧的这两篇文章：</p><p>“绿坝-花季护航”是一个笑话</p><p>Google，你不应该服务中国大陆（原文貌似已经被河蟹了）</p><p>这次央视门事件引发了我一些思考，搜索引擎到底该为谁服务？搜索结果到底应不应该过滤？</p><p>我们都知道，当搜索引擎出现的时候引发了&#8230;</p>]]></description> <content:encoded><![CDATA[<p>这阵子发生的滤霸和央视门事件被炒得沸沸扬扬的，但凡稍微有点网龄的人观点几乎都一边倒，骂滤霸，骂工信部，骂央视，只有少数一些五毛党以及类五毛党还在不断游离于各大知名站点为他们的雇主们“拨乱反正”。</p><p>关于这两事件详情参见可能吧的这两篇文章：</p><p>“绿坝-花季护航”是一个笑话</p><p>Google，你不应该服务中国大陆（原文貌似已经被河蟹了）</p><p>这次央视门事件引发了我一些思考，搜索引擎到底该为谁服务？搜索结果到底应不应该过滤？</p><p>我们都知道，当搜索引擎出现的时候引发了互联网的革命，信息的获取相比从前变得异常的简单。特别是当Google这个互联网巨头出现的时候，我们更有这种感觉。用Google的使命来说就是“组织全世界的信息，使人们能够随时随地地使用信息”。这个理念非常吸引人，Google想表达的意思是，<font color="#008000"><strong>当人们需要某种特定信息的时候，他们能够随时随地的在搜索引擎上面找到相应的入口点</strong></font>。但实际上，这个理念尚处于理想化的状态。看看我们现在的互联网各大主流搜索引擎，百度，雅虎等，当你搜索某个关键词的时候，很多时候你会发现，搜索结果充斥着大量乱七八糟的信息，有些是对你没用的东西，有些是你不应该看的东西，而有一些是误导你的东西，等等。</p><p>当然提高搜索技巧确实可以增加搜索准确度，但并不是很多人都是搜索高手。如果我们理想化的假设每个人都有很好的辨知能力的话，那么也无伤大碍。没用的东西一眼扫过，不该看的东西直接略过，误导你的东西一笑置之。但事实上，我们知道，大部分的人都不具备这样的能力。</p><p>对于未成年人来说，如果不小心搜索出了一些黄色淫秽的信息来，而旁边又没有人监督的时候，很容易就会丧失自制能力。这对未成年人来说是非常危险的。而对于政治观点比较偏激的人，如愤青一族，他们可能经常会搜一些敏感词，如果搜索结果没有做任何过滤，那么很可能会搜出一大堆的反动言论，要是轻信这些言论的话那么很容易导致社会的不稳定。</p><p>其实黄色信息并不是不好，当对象已成年的情况下；所谓的“反动言论”也并不是不好，我们不能一味的粉饰太平，经常我们可以再反动言论中看到当前政府的一些不足之处，如果处理得当，那么对当前政府和国家的帮助也是有的。</p><p>这就引出了我之前的两个思考，搜索引擎是一个大熔炉，里面什么东东都有，但是这些信息面向的对象并不是一样的，那么搜索结果是否应该以此为理由做过滤？如果要做过滤，那么谁来决定哪些信息应该被过滤呢？换句话说，搜索引擎到底应该是为谁服务的呢？</p><p>我觉得<font color="#008000"><strong>信息的自由化才是符合历史潮流的做法，搜索引擎应该服务于所有网民，信息的过滤权应该交还给网民自己。</strong></font></p><p>我们看看标榜自己是“自由国度”的美国（关于这方面的介绍可以阅读《历史的忧虑》系列书籍）。在美国，言论自由是受宪法保护的，而且他的自由度远远超过了我们被定义“自由”。你可以公开在报纸上骂当前政府无能，你可以去揭露某个官员的腐败，你甚至可以<a href="http://www.unicornblog.cn/user1/unicornblog/14277.html">出版一本书把政府的肮脏事都给说出来</a>。当然美国的自由也是有尺寸的，例如你不能随意诽谤其他人，在美国，诽谤罪也是很重的，可以把一家报纸搞垮。你也不能发表会立即造成破坏行动的言论，例如在大家上鼓动大家用武力去推翻政府。等等。自由也给美国带来了很多代价，但是美国依然坚持探索这条自由之路，并为此为自豪。</p><p>信息的传递工具越来越便捷，信息的获取越来容易，在这种趋势下，我们不可能因为害怕信息自由化造成的问题而去封锁这种自由，反而我们应该学习美国，以一种积极的心态去面对这股潮流。未来的信息战肯定是避免不了的了，如果我们现在就开始做好打这场战的准备，那么未来我们才能更加从容的去面对。</p><p>再说过滤权的问题。我觉得没有一个人能够将自己凌驾于其他人之上，来决定哪些内容其他人应该看，哪些内容其他人不应该看。对于信息的辨知能力，可能现在我们都还不成熟，但是网民是一个不断成熟的群体，我始终觉得只有在了解多方面的信息之后，一个人才能做出全面的准确的判断。如果我们搞信息封锁，过滤，那么网民得到的信息只是片面的，很容易造成偏激。如果政府觉得有些言论是在误导群众，那么他可以发表一些自己的言论，我觉得如果网民信任政府的话，那么描述同件事情的两个不同的言论，网民会更偏向于相信政府的观点。过度的掩饰、信息封锁反而导致网民对于政府的不信任。</p><p>再说未成年人，我觉得对于未成年人来说，信息的过滤权应该交由他们的监护人。毕竟他们的心智还很不成熟。从这一点上来讲，我非常支持政府去采购一款信息过滤软件免费供家长使用。可惜政府出发点是对的，走的路却是歪的╭(╯^╰)╮</p>标签：<a href="http://www.imkevinyang.com/tags/%e4%bf%a1%e6%81%af%e8%87%aa%e7%94%b1%e5%8c%96" title="信息自由化" rel="tag">信息自由化</a>, <a href="http://www.imkevinyang.com/tags/%e4%bf%a1%e6%81%af%e8%bf%87%e6%bb%a4" title="信息过滤" rel="tag">信息过滤</a>, <a href="http://www.imkevinyang.com/tags/%e5%a4%ae%e8%a7%86%e9%97%a8" title="央视门" rel="tag">央视门</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/categories/dailylife" title="生活网事" rel="tag">生活网事</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html" title="Robots.txt文件 (2009/05/06)">Robots.txt文件</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html" title="Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO) (2010/05/04)">Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO)</a> (2010/05/04)</li><li><a href="http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html" title="Silverlight SEO（搜索引擎优化）白皮书 (2009/04/06)">Silverlight SEO（搜索引擎优化）白皮书</a> (2009/04/06)</li><li><a href="http://www.imkevinyang.com/2009/03/%e5%85%8d%e8%b4%b9%e7%9a%84seo%e6%a3%80%e6%b5%8b%e5%b7%a5%e5%85%b7.html" title="免费的SEO检测工具 (2009/03/22)">免费的SEO检测工具</a> (2009/03/22)</li><li><a href="http://www.imkevinyang.com/2009/03/%e5%90%84%e5%a4%a7%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e6%94%b6%e5%bd%95%e5%85%a5%e5%8f%a3.html" title="各大搜索引擎收录入口 (2009/03/21)">各大搜索引擎收录入口</a> (2009/03/21)</li><li><a href="http://www.imkevinyang.com/2009/12/%e5%9c%a8wordpress%e4%b8%ad%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html" title="在Wordpress中轻松集成Google自定义搜索引擎 (2009/12/07)">在Wordpress中轻松集成Google自定义搜索引擎</a> (2009/12/07)</li><li><a href="http://www.imkevinyang.com/2009/05/%e5%a5%87%e6%80%aa%e7%9a%84%e7%99%be%e5%ba%a6%e6%94%b6%e5%bd%95%e7%8e%b0%e8%b1%a1.html" title="奇怪的百度收录现象 (2009/05/06)">奇怪的百度收录现象</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e4%ba%94-%e7%ae%80%e5%8d%95%e4%b9%8b%e7%be%8e%ef%bc%9a%e5%b8%83%e5%b0%94%e4%bb%a3%e6%95%b0%e5%92%8c%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html" title="数学之美系列五 &#8212; 简单之美：布尔代数和搜索引擎的索引 (2009/03/27)">数学之美系列五 &#8212; 简单之美：布尔代数和搜索引擎的索引</a> (2009/03/27)</li><li><a href="http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e5%8d%81%e4%b8%83-%e8%b0%88%e8%b0%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bd%9c%e5%bc%8a%e9%97%ae%e9%a2%98search-engine-anti-spam.html" title="数学之美系列十七 &#8212; 谈谈搜索引擎作弊问题(Search Engine Anti-SPAM) (2009/03/27)">数学之美系列十七 &#8212; 谈谈搜索引擎作弊问题(Search Engine Anti-SPAM)</a> (2009/03/27)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/06/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%88%b0%e5%ba%95%e8%af%a5%e4%b8%ba%e8%b0%81%e6%9c%8d%e5%8a%a1.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>2009年第一季度中国搜索引擎市场营收份额</title><link>http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html</link> <comments>http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html#comments</comments> <pubDate>Tue, 05 May 2009 17:48:24 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[生活网事]]></category> <category><![CDATA[市场份额]]></category> <category><![CDATA[搜索引擎]]></category> <category><![CDATA[百度]]></category> <category><![CDATA[谷歌]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html</guid> <description><![CDATA[<p>下图来自艾瑞发布的2009年第一季度网络经济数据报告《<a href="http://www.iresearch.com.cn/coredata/2009q1.asp">行业规模：经济危机下的网络经济走势</a>》。数据显示，跟同是艾瑞发布的<a href="http://www.eryi.org/SearchEngines/2008-2009-china-searchengine-market.html">2008搜索引擎市场份额</a>相比，2009年中国搜索引擎市场依然呈现百度和谷歌两家对垒的局面，两家的市场份额之和超过95%，其它搜索引擎的市场进一步被蚕食。 <br /><img alt="2009年第一季度中国搜索引擎市场营收份额" src="http://www.eryi.org/upload/google/2009q1-market.png" /> <br />值得注意的是，从这份数据来看谷歌中国的市场营收份额连续5个季度增加，至2009年第一季度已达32.8%；而百度的市场份额则从去年第三个季度开始下降，中国雅虎2009年Q1&#8230;</p>]]></description> <content:encoded><![CDATA[<p>下图来自艾瑞发布的2009年第一季度网络经济数据报告《<a href="http://www.iresearch.com.cn/coredata/2009q1.asp">行业规模：经济危机下的网络经济走势</a>》。数据显示，跟同是艾瑞发布的<a href="http://www.eryi.org/SearchEngines/2008-2009-china-searchengine-market.html">2008搜索引擎市场份额</a>相比，2009年中国搜索引擎市场依然呈现百度和谷歌两家对垒的局面，两家的市场份额之和超过95%，其它搜索引擎的市场进一步被蚕食。 <br /><img alt="2009年第一季度中国搜索引擎市场营收份额" src="http://www.eryi.org/upload/google/2009q1-market.png" /> <br />值得注意的是，从这份数据来看谷歌中国的市场营收份额连续5个季度增加，至2009年第一季度已达32.8%；而百度的市场份额则从去年第三个季度开始下降，中国雅虎2009年Q1的市场份额更是同比下降了7.1%之多。 <br />版权所有，转载时必须以链接的形式注明以下声明： <br />原载于 <a href="http://www.eryi.org/">搜索引擎周边</a> <br />链接地址 <a href="http://www.eryi.org/SearchEngines/2009Q1-searchengine-market.html">http://www.eryi.org/SearchEngines/2009Q1-searchengine-market.html</a></p>标签：<a href="http://www.imkevinyang.com/tags/%e5%b8%82%e5%9c%ba%e4%bb%bd%e9%a2%9d" title="市场份额" rel="tag">市场份额</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/categories/dailylife" title="生活网事" rel="tag">生活网事</a>, <a href="http://www.imkevinyang.com/tags/%e7%99%be%e5%ba%a6" title="百度" rel="tag">百度</a>, <a href="http://www.imkevinyang.com/tags/%e8%b0%b7%e6%ad%8c" title="谷歌" rel="tag">谷歌</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html" title="Robots.txt文件 (2009/05/06)">Robots.txt文件</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html" title="Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO) (2010/05/04)">Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO)</a> (2010/05/04)</li><li><a href="http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html" title="Silverlight SEO（搜索引擎优化）白皮书 (2009/04/06)">Silverlight SEO（搜索引擎优化）白皮书</a> (2009/04/06)</li><li><a href="http://www.imkevinyang.com/2009/03/%e5%85%8d%e8%b4%b9%e7%9a%84seo%e6%a3%80%e6%b5%8b%e5%b7%a5%e5%85%b7.html" title="免费的SEO检测工具 (2009/03/22)">免费的SEO检测工具</a> (2009/03/22)</li><li><a href="http://www.imkevinyang.com/2009/03/%e5%90%84%e5%a4%a7%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e6%94%b6%e5%bd%95%e5%85%a5%e5%8f%a3.html" title="各大搜索引擎收录入口 (2009/03/21)">各大搜索引擎收录入口</a> (2009/03/21)</li><li><a href="http://www.imkevinyang.com/2009/12/%e5%9c%a8wordpress%e4%b8%ad%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html" title="在Wordpress中轻松集成Google自定义搜索引擎 (2009/12/07)">在Wordpress中轻松集成Google自定义搜索引擎</a> (2009/12/07)</li><li><a href="http://www.imkevinyang.com/2009/05/%e5%a5%87%e6%80%aa%e7%9a%84%e7%99%be%e5%ba%a6%e6%94%b6%e5%bd%95%e7%8e%b0%e8%b1%a1.html" title="奇怪的百度收录现象 (2009/05/06)">奇怪的百度收录现象</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/06/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%88%b0%e5%ba%95%e8%af%a5%e4%b8%ba%e8%b0%81%e6%9c%8d%e5%8a%a1.html" title="搜索引擎到底该为谁服务 (2009/06/26)">搜索引擎到底该为谁服务</a> (2009/06/26)</li><li><a href="http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e4%ba%94-%e7%ae%80%e5%8d%95%e4%b9%8b%e7%be%8e%ef%bc%9a%e5%b8%83%e5%b0%94%e4%bb%a3%e6%95%b0%e5%92%8c%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html" title="数学之美系列五 &#8212; 简单之美：布尔代数和搜索引擎的索引 (2009/03/27)">数学之美系列五 &#8212; 简单之美：布尔代数和搜索引擎的索引</a> (2009/03/27)</li><li><a href="http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e5%8d%81%e4%b8%83-%e8%b0%88%e8%b0%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bd%9c%e5%bc%8a%e9%97%ae%e9%a2%98search-engine-anti-spam.html" title="数学之美系列十七 &#8212; 谈谈搜索引擎作弊问题(Search Engine Anti-SPAM) (2009/03/27)">数学之美系列十七 &#8212; 谈谈搜索引擎作弊问题(Search Engine Anti-SPAM)</a> (2009/03/27)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Robots.txt文件</title><link>http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html</link> <comments>http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html#comments</comments> <pubDate>Tue, 05 May 2009 17:46:18 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[代码库]]></category> <category><![CDATA[Robots]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[搜索引擎]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html</guid> <description><![CDATA[<pre class="csharpcode"># Robots.txt file from http://www.imkevinyang.com
# All robots will spider the domain

User-agent: *
Disallow:
Sitemap: http://www.imkevinyang.com/sitemap.xml</pre>标签：<a href="http://www.imkevinyang.com/tags/robots" title="Robots" rel="tag">Robots</a>, <a href="http://www.imkevinyang.com/tags/seo" title="SEO" rel="tag">SEO</a>, <a href="http://www.imkevinyang.com/categories/techarticles/codebase" title="代码库" rel="tag">代码库</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Mat&#8230;</a></li></ul>]]></description> <content:encoded><![CDATA[<pre class="csharpcode"># Robots.txt file from http://www.imkevinyang.com
# All robots will spider the domain

User-agent: *
Disallow:
Sitemap: http://www.imkevinyang.com/sitemap.xml</pre>标签：<a href="http://www.imkevinyang.com/tags/robots" title="Robots" rel="tag">Robots</a>, <a href="http://www.imkevinyang.com/tags/seo" title="SEO" rel="tag">SEO</a>, <a href="http://www.imkevinyang.com/categories/techarticles/codebase" title="代码库" rel="tag">代码库</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html" title="Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO) (2010/05/04)">Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO)</a> (2010/05/04)</li><li><a href="http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html" title="Silverlight SEO（搜索引擎优化）白皮书 (2009/04/06)">Silverlight SEO（搜索引擎优化）白皮书</a> (2009/04/06)</li><li><a href="http://www.imkevinyang.com/2009/07/%e4%b8%bawordpress%e5%8d%9a%e5%ae%a2%e5%8a%a0%e9%80%9f%e6%b8%85%e7%90%86%e4%bd%a0%e7%9a%84%e4%b8%bb%e9%a2%98%e6%96%87%e4%bb%b6.html" title="为Wordpress博客加速&mdash;&mdash;清理你的主题文件 (2009/07/26)">为Wordpress博客加速&mdash;&mdash;清理你的主题文件</a> (2009/07/26)</li><li><a href="http://www.imkevinyang.com/2009/03/%e5%85%8d%e8%b4%b9%e7%9a%84seo%e6%a3%80%e6%b5%8b%e5%b7%a5%e5%85%b7.html" title="免费的SEO检测工具 (2009/03/22)">免费的SEO检测工具</a> (2009/03/22)</li><li><a href="http://www.imkevinyang.com/2009/03/%e5%90%84%e5%a4%a7%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e6%94%b6%e5%bd%95%e5%85%a5%e5%8f%a3.html" title="各大搜索引擎收录入口 (2009/03/21)">各大搜索引擎收录入口</a> (2009/03/21)</li><li><a href="http://www.imkevinyang.com/2009/12/%e5%9c%a8wordpress%e4%b8%ad%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html" title="在Wordpress中轻松集成Google自定义搜索引擎 (2009/12/07)">在Wordpress中轻松集成Google自定义搜索引擎</a> (2009/12/07)</li><li><a href="http://www.imkevinyang.com/2009/05/%e5%a5%87%e6%80%aa%e7%9a%84%e7%99%be%e5%ba%a6%e6%94%b6%e5%bd%95%e7%8e%b0%e8%b1%a1.html" title="奇怪的百度收录现象 (2009/05/06)">奇怪的百度收录现象</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/06/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%88%b0%e5%ba%95%e8%af%a5%e4%b8%ba%e8%b0%81%e6%9c%8d%e5%8a%a1.html" title="搜索引擎到底该为谁服务 (2009/06/26)">搜索引擎到底该为谁服务</a> (2009/06/26)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>奇怪的百度收录现象</title><link>http://www.imkevinyang.com/2009/05/%e5%a5%87%e6%80%aa%e7%9a%84%e7%99%be%e5%ba%a6%e6%94%b6%e5%bd%95%e7%8e%b0%e8%b1%a1.html</link> <comments>http://www.imkevinyang.com/2009/05/%e5%a5%87%e6%80%aa%e7%9a%84%e7%99%be%e5%ba%a6%e6%94%b6%e5%bd%95%e7%8e%b0%e8%b1%a1.html#comments</comments> <pubDate>Tue, 05 May 2009 17:11:13 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[生活网事]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[搜索引擎]]></category> <category><![CDATA[收录]]></category> <category><![CDATA[百度]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/05/%e5%a5%87%e6%80%aa%e7%9a%84%e7%99%be%e5%ba%a6%e6%94%b6%e5%bd%95%e7%8e%b0%e8%b1%a1.html</guid> <description><![CDATA[<p>自从百度对我网站一个页面都不收录之后，我就很少关注百度了。这段时间很久没更新我的站点了，抽空看了一下Google和百度的收录数，发现百度竟然收录了很多篇文章了。看来同事说得对，百度收录一般是比较“迟钝”的，这种迟钝可能对于恶意刷排名起到一定的限制作用吧。</p>标签：<a href="http://www.imkevinyang.com/tags/seo" title="SEO" rel="tag">SEO</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/tags/%e6%94%b6%e5%bd%95" title="收录" rel="tag">收录</a>, <a href="http://www.imkevinyang.com/categories/dailylife" title="生活网事" rel="tag">生活网事</a>, <a href="http://www.imkevinyang.com/tags/%e7%99%be%e5%ba%a6" title="百度" rel="tag">百度</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (200&#8230;</li></ul>]]></description> <content:encoded><![CDATA[<p>自从百度对我网站一个页面都不收录之后，我就很少关注百度了。这段时间很久没更新我的站点了，抽空看了一下Google和百度的收录数，发现百度竟然收录了很多篇文章了。看来同事说得对，百度收录一般是比较“迟钝”的，这种迟钝可能对于恶意刷排名起到一定的限制作用吧。</p>标签：<a href="http://www.imkevinyang.com/tags/seo" title="SEO" rel="tag">SEO</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/tags/%e6%94%b6%e5%bd%95" title="收录" rel="tag">收录</a>, <a href="http://www.imkevinyang.com/categories/dailylife" title="生活网事" rel="tag">生活网事</a>, <a href="http://www.imkevinyang.com/tags/%e7%99%be%e5%ba%a6" title="百度" rel="tag">百度</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html" title="Robots.txt文件 (2009/05/06)">Robots.txt文件</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html" title="Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO) (2010/05/04)">Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO)</a> (2010/05/04)</li><li><a href="http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html" title="Silverlight SEO（搜索引擎优化）白皮书 (2009/04/06)">Silverlight SEO（搜索引擎优化）白皮书</a> (2009/04/06)</li><li><a href="http://www.imkevinyang.com/2009/07/%e4%b8%bawordpress%e5%8d%9a%e5%ae%a2%e5%8a%a0%e9%80%9f%e6%b8%85%e7%90%86%e4%bd%a0%e7%9a%84%e4%b8%bb%e9%a2%98%e6%96%87%e4%bb%b6.html" title="为Wordpress博客加速&mdash;&mdash;清理你的主题文件 (2009/07/26)">为Wordpress博客加速&mdash;&mdash;清理你的主题文件</a> (2009/07/26)</li><li><a href="http://www.imkevinyang.com/2009/03/%e5%85%8d%e8%b4%b9%e7%9a%84seo%e6%a3%80%e6%b5%8b%e5%b7%a5%e5%85%b7.html" title="免费的SEO检测工具 (2009/03/22)">免费的SEO检测工具</a> (2009/03/22)</li><li><a href="http://www.imkevinyang.com/2009/03/%e5%90%84%e5%a4%a7%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e6%94%b6%e5%bd%95%e5%85%a5%e5%8f%a3.html" title="各大搜索引擎收录入口 (2009/03/21)">各大搜索引擎收录入口</a> (2009/03/21)</li><li><a href="http://www.imkevinyang.com/2009/12/%e5%9c%a8wordpress%e4%b8%ad%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html" title="在Wordpress中轻松集成Google自定义搜索引擎 (2009/12/07)">在Wordpress中轻松集成Google自定义搜索引擎</a> (2009/12/07)</li><li><a href="http://www.imkevinyang.com/2009/09/%e6%84%9f%e5%8f%b9google%e7%9a%84%e6%94%b6%e5%bd%95%e9%80%9f%e5%ba%a6.html" title="感叹Google的收录速度 (2009/09/18)">感叹Google的收录速度</a> (2009/09/18)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/05/%e5%a5%87%e6%80%aa%e7%9a%84%e7%99%be%e5%ba%a6%e6%94%b6%e5%bd%95%e7%8e%b0%e8%b1%a1.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Silverlight SEO（搜索引擎优化）白皮书</title><link>http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html</link> <comments>http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html#comments</comments> <pubDate>Mon, 06 Apr 2009 13:47:03 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[Silverlight]]></category> <category><![CDATA[好文分享]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[搜索引擎]]></category> <category><![CDATA[白皮书]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html</guid> <description><![CDATA[<div class="statement"><span style="color: #ff0000;">转载说明: </span><p>英文原文出处：<a title="http://silverlight.net/learn/whitepapers/seo.aspx" href="http://silverlight.net/learn/whitepapers/seo.aspx">http://silverlight.net/learn/whitepapers/seo.aspx</a></p><p>中文翻译出处：http://www.mdong.org/?p=277</p></div><p>概要</p><p>这份文档描述了一些Silverlight程序的搜索引擎优化（SEO）技巧。这些技巧是用来帮助开发人员使得Silverlight内容能够在搜索引擎的结果页被发现，并为没有激活Silverlight的用户提供合意的体验。</p><p><strong>这份文档将包括以下的章节：</strong></p><p>*介&#8230;</p>]]></description> <content:encoded><![CDATA[<div class="statement"><span style="color: #ff0000;">转载说明: </span></p><p>英文原文出处：<a title="http://silverlight.net/learn/whitepapers/seo.aspx" href="http://silverlight.net/learn/whitepapers/seo.aspx">http://silverlight.net/learn/whitepapers/seo.aspx</a></p><p>中文翻译出处：http://www.mdong.org/?p=277</p></div><p>概要</p><p>这份文档描述了一些Silverlight程序的搜索引擎优化（SEO）技巧。这些技巧是用来帮助开发人员使得Silverlight内容能够在搜索引擎的结果页被发现，并为没有激活Silverlight的用户提供合意的体验。</p><p><strong>这份文档将包括以下的章节：</strong></p><p>*介绍<br /> *搜索引擎工作原理<br /> *开发Silverlight程序的方法<br /> *Silverlight程序的SEO技巧<br /> *总结</p><p><strong>介绍</strong></p><p>搜索引擎能够直接识别HTML内容。与此同时，搜索引擎先天的不识别Silverlight内容。这一点与搜索引擎不支持其它的一些通过HTML呈现的对象类似，如脚本、css、媒体文件以及ActiveX控件。为了使Silverlight内容能够被搜索引擎收录，你可以使用搜索引擎已经支持的方法，如将孤立的Silverlight岛与跟内容相关的HTML metadata相结合。</p><p>SEO的目的是增加页面在搜索引擎的主要结果页(图中被红色矩形标出的部分)的显示机会，而不是在广告或者赞助商的页面。</p><p><a href="http://www.mdong.org/wp-content/uploads/2008/11/fig1.jpg"><img title="搜索引擎的搜索结果页" src="http://www.mdong.org/wp-content/uploads/2008/11/fig1-300x206.jpg" alt="搜索引擎的搜索结果页" width="300" height="206" /></a></p><p>搜索引擎的搜索结果页</p><p>虽然搜索引擎技术的前景因为大量的竞争者不断地改进与革新正在迅速地变化，而SEO所依赖的搜索引擎算法中的一些基本原理是类似的。</p><p><strong>搜索引擎的工作原理</strong></p><p>搜索引擎能够抓取、评估与收录Web页面内容。抓取过程由搜索引擎爬虫（robot）执行，它们顺着网站的链接爬行并捕获内容。这时搜索引擎使用算法权重Web页面的价值。这个信息被用于建立搜索索引，也就是建立一个基于查询的结果页。<br /> 一个Web页面在搜索引擎的结果中会获很高的排名的主要原因是：页面中的词句与匹配的关键字在过去经常被搜索到。动态页面与不规范的元素，诸如页面中的脚本、样式表、对象以及embed标签等对搜索引擎来说是一种质疑，是一贯就就没有做好的领域。</p><p>在这种情况下，搜索引擎需要做以下的工作：</p><p>下载链接内容与关联的源页面相匹配。<br /> 在浏览器中解析、转换、执行或呈现元素以获得与用户浏览页面同等的体验。</p><p><a href="http://www.mdong.org/wp-content/uploads/2008/11/fig2.jpg"><img title="搜索引擎简化示意图" src="http://www.mdong.org/wp-content/uploads/2008/11/fig2.jpg" alt="搜索引简化擎示意图" width="500" height="232" /></a></p><p>搜索引擎简化示意图</p><p><strong>开发Silverlight程序的方法</strong></p><p>如果你正在计划开发一个Silverlight程序，那么你有许多工作可以做，以确保程序被搜索引擎发现并收录。</p><p>接下来是你可以采取的一些使得程序可以与HTML内容共存的方式。</p><p><strong>混合HTML与Silverlight内容</strong></p><p>该方式使得同一页面内的HTML文本与Silverlight内容相混合，它在功能上的递送更为丰富，原生的HTML内容也将被搜索引擎收录。为此，留心将Silverlight内容以适应内嵌或者环绕、字块的方式设计。这看起来像是格子中的交互构件适应在HTML文本的周围。 Silverlight程序的交互支持真正的文本比隐藏在搜索引擎可搜索的文本中将更具优势。</p><p><a href="http://www.mdong.org/wp-content/uploads/2008/11/fig3.jpg"><img title="岛式文本与Silverlight交互" src="http://www.mdong.org/wp-content/uploads/2008/11/fig3.jpg" alt="岛式文本与Silverlight交互" width="258" height="259" /></a></p><p>岛式文本与Silverlight交互</p><p><strong>使用HTML桥动态生成Silverlight内容</strong></p><p>这个方法略微难以实现，并限制Siverlight的体验。如果你拥有现有XHTML内容并希望使用Silverlight提升体验，使用这个方法你可以获得很大的成功。在这个方法中，XHTML内容是爬虫与低端（Down-Level）客户端的基础体验，Silverlight体验仅留作在客户端平台用户运行Silverlight。</p><p>在这个方法中，XHTML内容可以对目标客户端实现高保真的体验。它还公开的作为嵌套的预备内容内嵌在Silverlight插件的object标签中。一个属性从优雅降级模式区分出这个模式，这个模式中Silverlight程序的UI被嵌套预备内容所驱动。换句话说，程序逻辑会使用DOM桥用于取得object标签嵌套的预备内容，并使用它来构建Silverlight UI。使用XSLT转化XHTML到XAML将会变得更为简单，或者使用数据绑定，绑定XAML UI属性到提取的标记中的object呈现内容。</p><p><strong>优雅降级</strong></p><p>在这份文档中，主要关注通过优雅降级的方法达到的SEO。在这样的一个环境中，Silverlight内容是用户的主要体验，以嵌套在object标签的预备内容的使用作为低端体验。</p><p><strong>Silverlight程序的SEO技巧</strong></p><p>使得Silverlight内容被搜索引擎引索的关键因素是存在一个方法针对未激活Silverlight的系统与用户。包括以下情况：</p><p>*包含Silverlight内容的Web页面何如在当前不被Silverlight所支持的客户端/浏览器的配置中运作，如Opera或Windows 98。<br /> *对于使用无障碍程序（如屏幕阅读者与播音者）的用户来说Web页面如何运作？<br /> *对于使用文本浏览器的用户来说Web页面如何运作？如不支持脚本的Lynx等。</p><p>呈现相关的metadata与预备内容会使得Silverlight内容对于低端用户更为友好，这种友好对于搜索引擎也同样适用。</p><p>当创建Silverlight程序时，假设所有的用户已经安装了Silverlight或者有条件安装Silverlight。你准备如何为用户描述应用程序：</p><p>*了解你的用户。<br /> *计划如何向他们描述应用程序。<br /> *确定关键字，用于与搜索用户相联系。</p><p>你所使用的页面的标题以及头部片段、body内容、预备内容的关键词扮演了一个搜索引擎寻找与收录内容以及用户如何找到内容的重要角色。</p><p>下面的许多技术你可以用于优化搜索引擎结果并提升用户体验：</p><p>*使用描述的页面标题<br /> *增加描述Metadata<br /> *使用语义化的程序名称<br /> *使用object标签<br /> *确定Silverlight的预备内容<br /> *当使用Silverlight.js时使用creatObject<br /> *测试低端体验</p><p><strong>使用描述的页面标题</strong></p><p>给页面一个完美的标题。Web页面的作者必须修改与个性化页面中的标记，可以通过Visual Studio或者Expression Blend由Silverlight工程模板生成。为了有更好的讨论效果，我们假定你有一个Silverlight程序，提供西雅图地区的交通地图。图中展示了一个默认的页面标题与良好的页面标题。</p><p><a href="http://www.mdong.org/wp-content/uploads/2008/11/fig4.jpg"><img title="糟糕的页面标题与良好的页面标题" src="http://www.mdong.org/wp-content/uploads/2008/11/fig4.jpg" alt="糟糕的页面标题与良好的页面标题" width="474" height="147" /></a></p><p>糟糕的页面标题与良好的页面标题</p><p><strong>增加描述Metadata</strong></p><p>页面的关键词meta标签对于搜索引擎决定页面的rank值来说并不是很有效。但是，一个页面的标题与meta描述标签（属性名为description的meta标签）对于保证搜索用户在结果页查看你的页面与联系他们正在寻找的内容却有很大的帮助。</p><p>如果你有一个顶级(Top-Level)的Silverlight程序，占用了整个的客户端浏览器显示区域，或者一个依靠该程序的登录页面，这个时候你必须在HTML页面增加一个meta描述标签。下面的代码展示了meta描述标签的格式。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">head</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">meta</span> <span class="attr">name</span><span class="kwrd">="description"</span>
<span class="attr">content</span><span class="kwrd">="Silverlight development community..."</span> <span class="kwrd">&gt;</span>
...
<span class="kwrd">&lt;/</span><span class="html">head</span><span class="kwrd">&gt;</span></pre><p>如果有一个页面拥有大量的文本内容，并包括了相关的关键字，这时你可以忽略meta描述。搜索引擎会在结果页显示一部分你的页面的内容，任何残余的描述可能事实上被证明都不会显示。</p><p>下面的图像展示了一个包括描述的搜索页面入口的例子，以及当meta描述标签未定义时它将如何显示。</p><p><a href="http://www.mdong.org/wp-content/uploads/2008/11/fig5.jpg"><img title="搜索引擎结果页，有meta描述标签与没有meta描述标签" src="http://www.mdong.org/wp-content/uploads/2008/11/fig5.jpg" alt="搜索引擎结果页，有meta描述标签与没有meta描述标签" width="499" height="130" /></a></p><p>搜索引擎结果页，有meta描述标签与没有meta描述标签</p><p><strong>使用语义化的程序名称</strong></p><p>给应用程序赋予一个实用的名字是另外一个帮助搜索引擎找到你的Web页面的方式。如：一个应用程序提供了一个关于西雅图地区的交通地图，可以被命名为SeattleTrafficMaps.xap。</p><p>即使你的应用程序已经使用了一个不同的名字，修改它的名字也是相当容易。如：将MyTestSLApp.xap命名为 SeattleTrafficMaps.xap。当你没有在其它代码处使用这个程序名，回头修改它将是一个简单的操作。默认请况下，在 Silverlight模板中对其没有依赖。</p><p><strong>使用object标签</strong></p><p>object标签被设计用作HTML。如果在主object不能被载入显示内容，这时客户端浏览器会继续寻找在object标签中的替换内容。</p><p>Silverlight内容的发布者必须使用object标签（不是embed标签）来初始化Silverlight。下面的代码展示了如何加入object标签。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">object</span> <span class="attr">type</span><span class="kwrd">="application/x-silverlight-2"</span>
<span class="attr">data</span><span class="kwrd">="data:application/x-silverlight,"</span>
<span class="attr">width</span><span class="kwrd">="..."</span> <span class="attr">height</span><span class="kwrd">="..."</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">param</span> <span class="attr">name</span><span class="kwrd">="source"</span> <span class="attr">value</span><span class="kwrd">="SeattleTrafficMaps.xap"</span> <span class="kwrd">/&gt;</span>
<span class="rem">&lt;!-- Other parameters, if any --&gt;</span>
  ...
<span class="rem">&lt;!-- The “Get Silverlight” messages and badge --&gt;</span>
<span class="kwrd">&lt;</span><span class="html">p</span><span class="kwrd">&gt;</span>This content requires Microsoft Silverlight.
<span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">="http://go.microsoft.com/fwlink/?LinkID=124807"</span>
<span class="attr">style</span><span class="kwrd">="text-decoration: none;"</span><span class="kwrd">&gt;</span> 

<span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="http://go.microsoft.com/fwlink/?LinkId=108181"</span>
<span class="attr">alt</span><span class="kwrd">="Get Microsoft Silverlight"</span>
<span class="attr">style</span><span class="kwrd">="border-style: none"</span><span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">p</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">object</span><span class="kwrd">&gt;</span></pre><p><strong>确定Silverlight的预备内容</strong></p><p>Silverlight程序的object标签必须被补充嵌套在预备内容中，也就是被显示在缺少Silverlight的系统中的内部HTML。下面的代码显示了如何做到这点。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">object</span> <span class="attr">type</span><span class="kwrd">="application/x-silverlight-2"</span>
<span class="attr">data</span><span class="kwrd">="data:application/x-silverlight,"</span>
<span class="attr">width</span><span class="kwrd">="..."</span> <span class="attr">height</span><span class="kwrd">="..."</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">param</span> <span class="attr">name</span><span class="kwrd">="source"</span> <span class="attr">value</span><span class="kwrd">="SeattleTrafficMaps.xap"</span> <span class="kwrd">/&gt;</span>
<span class="rem">&lt;!-- Other parameters, if any --&gt;</span>
  ...
<span class="rem">&lt;!-- Nested alternate HTML content for search --&gt;</span>
<span class="kwrd">&lt;</span><span class="html">h3</span><span class="kwrd">&gt;</span>Traffic map of the Seattle-Puget Sound area<span class="kwrd">&lt;/</span><span class="html">h3</span><span class="kwrd">&gt;</span> 

<span class="kwrd">&lt;</span><span class="html">p</span><span class="kwrd">&gt;</span>Up-to-the-minute traffic situation overlaid on the map of
     the Seattle-Puget Sound area, powered by
<span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">="http://maps.live.com"</span><span class="kwrd">&gt;</span>Live Maps<span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">p</span><span class="kwrd">&gt;</span> 

<span class="rem">&lt;!-- Canned image representing the application contents --&gt;</span>
<span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="SeattleTraffic_RushHour.jpg"</span>
<span class="attr">alt</span><span class="kwrd">="Seattle traffic at 5:30pm (evening rush-hour)"</span> <span class="kwrd">/&gt;</span>
<span class="rem">&lt;!-- The “Get Silverlight” message and badge --&gt;</span>
<span class="kwrd">&lt;</span><span class="html">p</span><span class="kwrd">&gt;</span>This content requires Microsoft Silverlight.
<span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">="http://go.microsoft.com/fwlink/?LinkID=124807"</span>
<span class="attr">style</span><span class="kwrd">="text-decoration: none;"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="http://go.microsoft.com/fwlink/?LinkId=108181"</span>
<span class="attr">alt</span><span class="kwrd">="Get Microsoft Silverlight"</span>
<span class="attr">style</span><span class="kwrd">="border-style: none"</span><span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">p</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">object</span><span class="kwrd">&gt;</span></pre><p><strong>当使用Silverlight.js时使用createObject</strong></p><p>Silverlight.js的主函数供于跨平台、跨浏览器，借助构建恰当的标记使得Silverlight内容与HTML DOM相挂钩。典型的，包括围绕浏览器工作的object标签。createObject函数统一提供了父级元素的id，如：一个div或者span的内嵌，Silverlight object会作为子元素挂钩。这个方法使用了以下的逻辑。</p><pre class="csharpcode"><span class="kwrd">if</span> (slParentElement != <span class="kwrd">null</span>) {
   slParentElement.innerHTML = slPluginHTML;
}</pre><p>假设你的标记由以下组成。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="divWithinWhichSLObjectExists"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&gt;</span>
&lt;!--
    Silverlight.createObject(<span class="str">"slObjectId"</span>,
                             <span class="str">"divWithinWhichSLObjectExists"</span>,
                             ...); 

<span class="rem">// --&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span></pre><p>当浏览器运行时，有效的DOM应该如下面的代码。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="divWithinWhichSLObjectExists"</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">object</span> <span class="attr">classid</span><span class="kwrd">="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"</span>
 <span class="attr">width</span><span class="kwrd">="100"</span> <span class="attr">height</span><span class="kwrd">="100"</span>
<span class="attr">codebase</span><span class="kwrd">="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">param</span> <span class="attr">name</span><span class="kwrd">="source"</span> <span class="attr">value</span><span class="kwrd">="SeattleTrafficMaps.xap"</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">embed</span> <span class="attr">type</span><span class="kwrd">="application/x-shockwave-flash"</span> <span class="attr">width</span><span class="kwrd">="100"</span> <span class="attr">height</span><span class="kwrd">="100"</span> <span class="attr">source</span><span class="kwrd">="SeattleTrafficMaps.xap"</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">embed</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">object</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span></pre><p>存在附带产生有益的效用供于以下原因：更换父级div的内部HTML移动了该div中任何其它现有的子元素。搜索引擎会在所有脚本执行与改变DOM之前经常分析与引索标记。</p><p>换句话说，你可以增加详尽的相关的metadata作为内在HTML内嵌在Silverlight object中的父级div元素。搜索引擎会处理metadata，但是metadata不会显示在浏览器中。</p><p>如果你的父级div已经嵌套了关联的内容，下面的代码将是蜘蛛能够看到的。</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="divWithinWhichSLObjectExists"</span><span class="kwrd">&gt;&lt;!</span><span class="html">--</span> <span class="attr">Nested</span> <span class="attr">alternate</span> <span class="attr">HTML</span> <span class="attr">content</span> <span class="attr">for</span> <span class="attr">search</span> <span class="attr">--</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">div</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">h3</span><span class="kwrd">&gt;</span>Traffic map of the Seattle-Puget Sound area<span class="kwrd">&lt;/</span><span class="html">h3</span><span class="kwrd">&gt;</span>
Up-to-the-minute traffic situation overlaid on the map of
the Seattle-Puget Sound area, powered by
<span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">="http://maps.live.com"</span><span class="kwrd">&gt;</span>Live Maps<span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span> 

<span class="rem">&lt;!-- canned image representing app contents --&gt;</span>
<span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="SeattleTraffic_RushHour.jpg"</span> <span class="attr">alt</span><span class="kwrd">=""</span> <span class="kwrd">/&gt;</span> alt="Seattle traffic at 5:30pm (evening rush-hour)" /<span class="attr">&amp;gt;</span><span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>
<span class="rem">&lt;!-- Invocation of the createObject function in Silverlight.js --&gt;</span>
<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&gt;&lt;!</span><span class="html">--</span>
    <span class="attr">Silverlight</span>.<span class="attr">createObject</span>(<span class="kwrd">"slObjectId"</span>, //<span class="attr">SL</span> <span class="attr">plug-in</span> <span class="attr">id</span>
                             <span class="kwrd">"divWithinWhichSLObjectExists"</span>, //<span class="attr">parent</span> <span class="attr">id</span>
                             ...); 

// <span class="attr">--</span><span class="kwrd">&gt;&lt;/</span><span class="html">script</span><span class="kwrd">&gt;&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span></pre><p><strong>测试低端体验</strong></p><p>不管内容中相关的Silverlight与HTML的如何重要，针对没有安装Silverlight的用户的页面测试是非常必要的。</p><p>使得低端用户可以访问这个页面，执行以下步骤：</p><p>1.关闭所有的Internet请求，启动一个新的请求。</p><p>2.在工具菜单，选择管理加载项，然后点击开启/禁止加载项。会弹出管理加载项对话框。</p><p>3.选择Microsoft Silverlight，选择禁用按钮，然后点击确定。</p><p>4.重启Internet Explorer并操作转向有Silverlight内容的Web页面。</p><p>5.重复返回管理加载项对话框，选择Microsoft Silverlight、并选择启用。</p><p>注：</p><p>用于临时关闭Silverlight插件的程序仅作用于当前使用的浏览器。</p><p>当你测试低端体验完毕，值得在你的页面中加入一个统计工具，如SEO浏览器以了解标记的效果以及SEO的内容。</p><p><strong>总结</strong></p><p>搜索引擎收录非原生的HTML内容的能力非常有限。但是，如果你通过几种方式构造并呈现了你的应用程序，这将有更大的可能性响应到搜索查询并显示在搜索引擎结果页。</p><h5>英文原文</h5><p>Search Engine Optimization for Silverlight applications</p><p>Ashish Shetty</p><p>Microsoft Corporation</p><p>October 2008</p><p>Summary</p><p>This document describes some best practices for search engine optimization of Silverlight applications. These practices are designed to help developers make their Silverlight content discoverable on a search engine results page and to provide an acceptable experience for users who do not have Silverlight enabled.</p><p>This document contains the following sections:</p><ul><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#introduction">Introduction</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#how_search_engines_work">How Search Engines Work</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#approaches_for_developing_a_silverlight_application">Approaches for Developing a Silverlight Application</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#search_engine_optimization_techniques_for_silverlight_applications">Search Engine Optimization Techniques for Silverlight Applications</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#conclusion">Conclusion</a></li></ul><p>Introduction</p><p>Search engines are geared toward recognizing HTML content. At this time, they do not recognize Silverlight content natively. This is similar to the search engine support for other objects on the HTML page, such as script blocks, CSS blocks, media files, and ActiveX controls. To make Silverlight content indexable by search engines, you can use approaches that search engines are already familiar with, such as combining the islands of Silverlight content with HTML metadata about that content.</p><p>The goal of search engine optimization (SEO) is to increase the chances that your page will appear in the main section of the search engine results page (outlined by the red rectangle in Figure 1), not the paid or sponsored results.</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image001.jpg"><img style="margin: 0px 0px 10px; display: inline; border-width: 0px;" title="clip_image001" src="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image001-thumb.jpg" border="0" alt="clip_image001" width="612" height="423" /></a></p><p>Figure 1 - Search engine results page</p><p>Even though the search landscape is rapidly changing, with multiple competitors continuously improving and evolving how they implement search, SEO relies on some fundamental similarities among search engine algorithms.</p><p>How Search Engines Work</p><p>Search engines crawl, weight, and index Web page content. Crawling is done by a search robot that traverses the links in a Web site and captures the content. Search engines then use algorithms and heuristics to assign weights to Web pages. This information is used to build the search index, which is used to build a results page based on your query.</p><p>The main reason for a Web page to be highly ranked in search engine results is that the words on the page match the keywords that are used to search. The presence of dynamic and nonstandard elements such as script, style, object, and embed tags in the page is a challenge to search engines, and this is an area where they have traditionally not done well.</p><p>In this situation, search engines have to do the following:</p><ul><li>Download linked content and associate it with the source page.</li><li>Parse, convert, execute, or render elements to obtain the same experience as the user viewing the page in a browser.</li></ul><p>Figure 2 is a simplified view of how a search engine works.</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image002.jpg"><img style="margin: 0px 0px 10px; display: inline; border-width: 0px;" title="clip_image002" src="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image002-thumb.jpg" border="0" alt="clip_image002" width="563" height="264" /></a></p><p>Figure 2 - A simplified view of a search engine</p><p>Approaches for Developing a Silverlight Application</p><p>If you are planning to build a Silverlight application, there are things you can do to make sure that your application is discovered and returned by search engines.</p><p>The following are some of the patterns that you can adopt for how your application coexists with the HTML content.</p><p>Mix HTML with Silverlight Content</p><p>This pattern involves mixing HTML text with Silverlight content in the same page so that it delivers richness in functionality and the native HTML content is consumable by search engines. To do this, consider designing your Silverlight content in such a way that it fits within, or around, a block of text. This looks like a grid of interacting components that fit around HTML text. An advantage of this approach is that it ensures that your Silverlight interactivity is truly supporting the text, rather than hiding otherwise searchable text from search engines. Figure 3 shows a Web page with this approach.</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image003.jpg"><img style="margin: 0px 0px 10px; display: inline; border-width: 0px;" title="clip_image003" src="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image003-thumb.jpg" border="0" alt="clip_image003" width="262" height="263" /></a></p><p>Figure 3 - Islands of text and Silverlight interactivity</p><p>Use HTML Bridge to Generate Silverlight Content Dynamically</p><p>This approach is slightly harder to achieve and can be limiting to the Silverlight experience. You will have most success with this approach if you have existing XHTML content and want to enhance the experience with Silverlight. In this approach, the XHTML content is the base experience for search robots and down-level clients, while the Silverlight experience is reserved for consumers on client platforms capable of running Silverlight.</p><p>In this approach, the XHTML content has the full-fidelity experience for its target clients. It is still declared as nested alternate content within the object tag for the Silverlight plug-in. The one attribute that differentiates this pattern from the graceful degradation pattern is that in this pattern, the Silverlight application’s UI is driven by the nested alternate content. In other words, application logic will use the DOM Bridge to get the nested alternate content from the object tag and use it to construct the Silverlight UI. This can be as simple as using XSLT to transform the XHTML to XAML, or perhaps using data binding to bind XAML UI properties to an object representing content from the extracted markup.</p><p>Graceful Degradation</p><p>In this document, we focus primarily on search engine optimization using the graceful degradation approach. In such a scenario, the Silverlight content is the primary experience for consumers, and the use of nested alternate content within the object tag serves as the down-level experience.</p><p>Search Engine Optimization Techniques for Silverlight Applications</p><p>The key consideration for making Silverlight content indexable by search engines is to use the approaches that are used for systems and users for which Silverlight is not enabled. Considerations include the following:</p><ul><li>How the Web page with Silverlight content behaves in client/browser configurations such as Opera or Windows 98, which are not currently supported by Silverlight.</li><li>How the Web page behaves for customers who use accessibility programs such as screen readers and narrators.</li><li>How the Web page behaves for customers who use from a text browser such as Lynx, where no scripts can execute.</li></ul><p>Presenting contextual metadata and alternate content that would make Silverlight content friendly to down-level users will also make it friendly to search engines.</p><p>When creating your Silverlight application, do not assume that all users will have Silverlight installed or have computers with the ability to install Silverlight. Prepare for how you would describe your application to these users.</p><ul><li>Know your audience.</li><li>Plan on how you would describe your application to them.</li><li>Identify the keywords that you would use to connect with searchers.</li></ul><p>The words that you use in your titles, page and section headers, body content, and alternate content play an important role in how the search engines find and index your content, and also how a user finds your content.</p><p>The following are some of the techniques you can use to optimize your search engine results and improve the experience for all users:</p><ul><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#use_a_descriptive_page_title">Use a Descriptive Page Title</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#add_description_metadata">Add Description Metadata</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#use_a_meaningful_application_name">Use a Meaningful Application Name</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#use_the_object_tag">Use the object Tag</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#specify_alternate_content_for_silverlight">Specify Alternate Content for Silverlight</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#use_createobject_when_using_silverlight.js">Use createObject When Using Silverlight.js</a></li><li><a href="http://silverlight.net/learn/whitepapers/seo.aspx#test_downlevel_experiences">Test Down-Level Experiences</a></li></ul><p>Use a Descriptive Page Title</p><p>Give your page a good title. Web page authors must update and customize the markup in the pages generated by Silverlight project templates in Visual Studio or Expression Blend. For the purposes of discussion, let’s assume you have a Silverlight application that provides interactive traffic maps for the Seattle area. Figure 4 shows bad (default) and good Web page titles.</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image004.jpg"><img style="margin: 0px 0px 10px; display: inline; border-width: 0px;" title="clip_image004" src="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image004-thumb.jpg" border="0" alt="clip_image004" width="478" height="151" /></a></p><p>Figure 4 - Bad and good page titles</p><p>Add Description Metadata</p><p>Keywords in your page’s meta tag are not very useful for search engines to determine your page’s rank. However, a page title and meta description tag (that is, a meta tag whose name attribute is set to "description") are extremely useful in ensuring that searchers who view your page on a results page associate it with content that they are looking for.</p><p>If you have a top-level Silverlight application that occupies the full extent of the browser’s client area, or one that exists on your landing page, then you must have a meta description tag on your HTML page. The following code shows the format of the meta description tag.</p><p>&lt;head&gt; &lt;meta name="description" content="Microsoft portal site for the Silverlight development community..." &gt; ... &lt;/head&gt;</p><p>If you have a page with a lot of text content that contains relevant keywords, then you can omit the meta description. The search engine will show a portion of your page content on the results page, and any stub description may actually prove counterproductive.</p><p>The following figure shows a sample search page entry with a description, and how it would appear if the meta description tag were not present.</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image005.jpg"><img style="margin: 0px 0px 10px; display: inline; border-width: 0px;" title="clip_image005" src="http://www.imkevinyang.com/wp-content/uploads/2009/04/clip-image005-thumb.jpg" border="0" alt="clip_image005" width="568" height="151" /></a></p><p>Figure 5 - Search results page with and without a meta description tag</p><p>Use a Meaningful Application Name</p><p>Giving a useful name to your application is another way to help the search engines find your Web page. For example, an application that provides traffic maps for the Seattle area could be named SeattleTrafficMaps.xap.</p><p>Even if your application was built using a different name, it is easy to change the name, for example, from MyTestSLApp.xap to SeattleTrafficMaps.xap. Changing the name back at a later time is a simple operation if that name is not referred to elsewhere in your code. By default, there are no dependencies of this kind in the Silverlight templates.</p><p>Use the object Tag</p><p>The object tag in HTML is designed so that if the main object cannot be loaded to display content, then browser clients will continue to look for alternative content within the object tag.</p><p>Silverlight content publishers must use the object tag (not the embed tag) to instantiate Silverlight. The following code shows how you can add the object tag.</p><p>&lt;object type="application/x-silverlight-2" data="data:application/x-silverlight," width="..." height="..."&gt; &lt;param name="source" value="SeattleTrafficMaps.xap" /&gt; &lt;!-- Other parameters, if any --&gt; ... &lt;!-- The “Get Silverlight” messages and badge --&gt; &lt;p&gt;This content requires Microsoft Silverlight. &lt;a href="<a href="http://go.microsoft.com/fwlink/?LinkID=124807">http://go.microsoft.com/fwlink/?LinkID=124807</a>" style="text-decoration: none;"&gt; &lt;img src="<a href="http://go.microsoft.com/fwlink/?LinkId=108181">http://go.microsoft.com/fwlink/?LinkId=108181</a>" alt="Get Microsoft Silverlight" style="border-style: none"/&gt; &lt;/a&gt; &lt;/p&gt; &lt;/object&gt;</p><p>Specify Alternate Content for Silverlight</p><p>The object tag for the Silverlight application must be supplemented with nested alternate content, namely the inner HTML that is displayed on systems where Silverlight is absent. The following code shows how you can do that.</p><p>&lt;object type="application/x-silverlight-2" data="data:application/x-silverlight," width="..." height="..."&gt; &lt;param name="source" value="SeattleTrafficMaps.xap" /&gt; &lt;!-- Other parameters, if any --&gt; ... &lt;!-- Nested alternate HTML content for search --&gt; &lt;h3&gt;Traffic map of the Seattle-Puget Sound area&lt;/h3&gt; &lt;p&gt;Up-to-the-minute traffic situation overlaid on the map of the Seattle-Puget Sound area, powered by &lt;a href="http://maps.live.com"&gt;Live Maps&lt;/a&gt; &lt;/p&gt; &lt;!-- Canned image representing the application contents --&gt; &lt;img src="SeattleTraffic_RushHour.jpg" alt="Seattle traffic at 5:30pm (evening rush-hour)" /&gt; &lt;!-- The “Get Silverlight” message and badge --&gt; &lt;p&gt;This content requires Microsoft Silverlight. &lt;a href="<a href="http://go.microsoft.com/fwlink/?LinkID=124807">http://go.microsoft.com/fwlink/?LinkID=124807</a>" style="text-decoration: none;"&gt; &lt;img src="<a href="http://go.microsoft.com/fwlink/?LinkId=108181">http://go.microsoft.com/fwlink/?LinkId=108181</a>" alt="Get Microsoft Silverlight" style="border-style: none"/&gt; &lt;/a&gt; &lt;/p&gt; &lt;/object&gt;</p><p>Use createObject When Using Silverlight.js</p><p>The primary function of Silverlight.js is to provide a cross-browser, cross-platform means of constructing the right markup to get Silverlight content hooked up to the HTML DOM. Typically this involves working around browser quirks to generate the object tag with the right set of parameters. The createObject function also takes the id of a parent element, for example a div or span, within which the Silverlight object will be hooked up as child element. This approach uses the following logic.</p><p>if (slParentElement != null) { slParentElement.innerHTML = slPluginHTML; }</p><p>For example, assume that your markup consisted of the following code.</p><p>&lt;div id="divWithinWhichSLObjectExists"&gt; &lt;script type="text/javascript"&gt; Silverlight.createObject("slObjectId", "divWithinWhichSLObjectExists", ...); &lt;/script&gt; &lt;/div&gt;</p><p>The effective DOM would be like the following code when executed on the browser.</p><p>&lt;div id="divWithinWhichSLObjectExists"&gt; &lt;object type="application/x-silverlight-2" data="data:application/x-silverlight," width="..." height="..."&gt; &lt;param name="source" value="SeattleTrafficMaps.xap" /&gt; &lt;!-- Other Parameters, if any --&gt; ... &lt;!-- The “Get Silverlight” message and badge --&gt; &lt;p&gt;This content requires Microsoft Silverlight. &lt;a href="<a href="http://go.microsoft.com/fwlink/?LinkID=124807">http://go.microsoft.com/fwlink/?LinkID=124807</a>" style="text-decoration: none;"&gt; &lt;img src="<a href="http://go.microsoft.com/fwlink/?LinkId=108181">http://go.microsoft.com/fwlink/?LinkId=108181</a>" alt="Get Microsoft Silverlight" style="border-style: none"/&gt; &lt;/a&gt; &lt;/p&gt; &lt;/object&gt; &lt;/div&gt;</p><p>This has a beneficial side effect for the following reasons:</p><ul><li>Replacing the inner HTML of the parent div removes any other existing child elements in that div.</li><li>Search engines often parse and index markup as it is served—before any scripts execute and change the DOM.</li></ul><p>In other words, you can add detailed contextual metadata as native HTML within the parent div element of the Silverlight object. Search engines will process the metadata, but the metadata will not show up in the browser.</p><p>If your parent div has nested contextual content, the following code is what the search robot sees.</p><p>&lt;div id="divWithinWhichSLObjectExists"&gt; &lt;!-- Nested alternate HTML content for search --&gt; &lt;div&gt; &lt;h3&gt;Traffic map of the Seattle-Puget Sound area&lt;/h3&gt; &lt;p&gt;Up-to-the-minute traffic situation overlaid on the map of the Seattle-Puget Sound area, powered by &lt;a href="http://maps.live.com"&gt;Live Maps&lt;/a&gt; &lt;/p&gt; &lt;!-- canned image representing app contents --&gt; &lt;img src="SeattleTraffic_RushHour.jpg" alt="Seattle traffic at 5:30pm (evening rush-hour)" /&gt; &lt;/div&gt; &lt;!-- Invocation of the createObject function in Silverlight.js --&gt; &lt;script type="text/javascript"&gt; Silverlight.createObject("slObjectId", //SL plug-in id "divWithinWhichSLObjectExists", //parent id ...); &lt;/script&gt; &lt;/div&gt;</p><p>Test Down-Level Experiences</p><p>Regardless of the relative importance of Silverlight and HTML in your content, it is important to test the page as a user who does not have Silverlight installed.</p><p>To access the page as a down-level user, perform the following steps:</p><ol><li>Close all instances of Internet Explorer, and then start a new instance.</li><li>On the Tools menu, point to Manage Add-ons, and then click Enable or Disable Add-ons. The Manage Add-ons dialog box is displayed.</li><li>Select Microsoft Silverlight, select the Disable button, and then click OK.</li><li>Restart Internet Explorer and navigate to the Web page that has your Silverlight content.</li></ol><p>To revert, return to the Manage Add-ons dialog box, select Microsoft Silverlight, and select Enable.</p><p>Note</p><p>The procedure for temporarily disabling the Silverlight plug-in differs depending on the browser you are using.</p><p>After you have tested the down-level experience, it is worthwhile validating your page with a static analysis tool such as <a href="http://seo-browser.com/">SEO Browser</a> that understands the impact of markup and content on search engine optimization.</p><p>Conclusion</p><p>The ability of search engines to index content that is not native HTML is very limited. However, if you structure and present your Silverlight application in certain ways, they have a better chance of appearing on a search engine results page in response to a search query.</p>标签：<a href="http://www.imkevinyang.com/tags/seo" title="SEO" rel="tag">SEO</a>, <a href="http://www.imkevinyang.com/categories/techarticles/silverlight" title="Silverlight" rel="tag">Silverlight</a>, <a href="http://www.imkevinyang.com/tags/silverlight" title="Silverlight" rel="tag">Silverlight</a>, <a href="http://www.imkevinyang.com/categories/greatpoststoshare" title="好文分享" rel="tag">好文分享</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/tags/%e7%99%bd%e7%9a%ae%e4%b9%a6" title="白皮书" rel="tag">白皮书</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/09/blend%e5%b0%8f%e8%b4%b4%e5%a3%ab%e6%94%b9%e5%8f%98%e9%bc%a0%e6%a0%87%e6%bb%9a%e8%bd%ae%e7%9a%84%e9%bb%98%e8%ae%a4%e8%a1%8c%e4%b8%ba-2.html" title="Blend小贴士&mdash;&mdash;改变鼠标滚轮的默认行为 (2009/09/18)">Blend小贴士&mdash;&mdash;改变鼠标滚轮的默认行为</a> (2009/09/18)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html" title="Robots.txt文件 (2009/05/06)">Robots.txt文件</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/02/silverlight-2-rtm-%e5%a4%9a%e5%9b%bd%e8%af%ad%e8%a8%80%e6%94%af%e6%8c%81%ef%bc%88%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e6%9c%ac%e5%9c%b0%e5%8c%96%ef%bc%89.html" title="Silverlight 2 RTM 多国语言支持（应用程序本地化） (2009/02/28)">Silverlight 2 RTM 多国语言支持（应用程序本地化）</a> (2009/02/28)</li><li><a href="http://www.imkevinyang.com/2009/03/silverlight-2%e5%8a%a8%e6%80%81%e5%8a%a0%e8%bd%bdxap%e5%8c%85%e4%b8%ad%e7%9a%84%e7%a8%8b%e5%ba%8f%e9%9b%86.html" title="Silverlight 2动态加载Xap包中的程序集 (2009/03/02)">Silverlight 2动态加载Xap包中的程序集</a> (2009/03/02)</li><li><a href="http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html" title="Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO) (2010/05/04)">Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO)</a> (2010/05/04)</li><li><a href="http://www.imkevinyang.com/2009/03/silverlight2-%e5%8a%a8%e6%80%81%e5%8a%a0%e8%bd%bd%e7%a8%8b%e5%ba%8f%e9%9b%86-ondemand%e6%a8%a1%e5%bc%8fdynamic-load-assembly.html" title="Silverlight2 动态加载程序集&#8212;OnDemand模式(Dynamic Load Assembly) (2009/03/02)">Silverlight2 动态加载程序集&#8212;OnDemand模式(Dynamic Load Assembly)</a> (2009/03/02)</li><li><a href="http://www.imkevinyang.com/2010/02/silverlight%e5%90%af%e7%94%a8assembly-caching%e4%b9%8b%e5%90%8e%e9%93%81%e9%80%9a%e7%94%a8%e6%88%b7%e6%97%a0%e6%b3%95%e8%ae%bf%e9%97%ae.html" title="Silverlight启用Assembly Caching之后铁通用户无法访问 (2010/02/13)">Silverlight启用Assembly Caching之后铁通用户无法访问</a> (2010/02/13)</li><li><a href="http://www.imkevinyang.com/2010/03/silverlight%e7%9a%84%e4%be%9d%e8%b5%96%e5%b1%9e%e6%80%a7%e4%b8%8e%e9%99%84%e5%8a%a0%e5%b1%9e%e6%80%a7.html" title="Silverlight的依赖属性与附加属性 (2010/03/28)">Silverlight的依赖属性与附加属性</a> (2010/03/28)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>数学之美系列十七 &#8212; 谈谈搜索引擎作弊问题(Search Engine Anti-SPAM)</title><link>http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e5%8d%81%e4%b8%83-%e8%b0%88%e8%b0%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bd%9c%e5%bc%8a%e9%97%ae%e9%a2%98search-engine-anti-spam.html</link> <comments>http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e5%8d%81%e4%b8%83-%e8%b0%88%e8%b0%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bd%9c%e5%bc%8a%e9%97%ae%e9%a2%98search-engine-anti-spam.html#comments</comments> <pubDate>Thu, 26 Mar 2009 23:17:48 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[好文分享]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[反作弊]]></category> <category><![CDATA[搜索引擎]]></category> <category><![CDATA[数学之美]]></category> <category><![CDATA[系列文章]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e5%8d%81%e4%b8%83-%e8%b0%88%e8%b0%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bd%9c%e5%bc%8a%e9%97%ae%e9%a2%98search-engine-anti-spam.html</guid> <description><![CDATA[<ul><p>2006年11月28日 上午 03:18:00</p><p>Google 研究员 吴军</p><p>自从有了搜索引擎，就有了针对搜索引擎网页排名的作弊(SPAM)。以至于用户发现在搜索引擎中排名靠前的网页不一定就是高质量的，用句俗话说，闪光的不一定是金子。</p><p>搜索引擎的作弊，虽然方法很多，目的只有一个，就是采用不正当手段提高自己网页的排名。早期最常见的作弊方法是重复关键词。比如一个卖数码相机的网站，重复地罗列各种数码相机的品牌，如尼康、佳能和柯达等等。为了不让读者看到众多讨厌&#8230;</p></ul>]]></description> <content:encoded><![CDATA[<ul><p>2006年11月28日 上午 03:18:00</p><p>Google 研究员 吴军</p><p>自从有了搜索引擎，就有了针对搜索引擎网页排名的作弊(SPAM)。以至于用户发现在搜索引擎中排名靠前的网页不一定就是高质量的，用句俗话说，闪光的不一定是金子。</p><p>搜索引擎的作弊，虽然方法很多，目的只有一个，就是采用不正当手段提高自己网页的排名。早期最常见的作弊方法是重复关键词。比如一个卖数码相机的网站，重复地罗列各种数码相机的品牌，如尼康、佳能和柯达等等。为了不让读者看到众多讨厌的关键词，聪明一点的作弊者常用很小的字体和与背景相同的颜色来掩盖这些关键词。其实，这种做法很容易被搜索引擎发现并纠正。</p><p>在有了网页排名(page rank)以后，作弊者发现一个网页被引用的连接越多，排名就可能越靠前，于是就有了专门卖链接和买链接的生意。比如，有人自己创建成百上千个网站，这些网站上没有实质的内容，只有到他们的客户网站的连接。这种做法比重复关键词要高明得多，但是还是不太难被发现。因为那些所谓帮别人提高排名的网站，为了维持生意需要大量地卖链接，所以很容易露马脚。（这就如同造假钞票，当某一种假钞票的流通量相当大以后，就容易找到根源了。）再以后，又有了形形色色的作弊方式，我们就不在这里一一赘述了。</p><p>几年前，我加入Google做的第一件事就是消除网络作弊。在Google最早发现搜索引擎作弊的是Matt Cutts，他在我加入Google前几个月开始研究这个问题，后来，辛格，马丁和我先后加入进来。我们经过几个月的努力，清除了一半的作弊者。(当然，以后抓作弊的效率就不会有这么高了。）其中一部分网站从此&quot;痛改前非&quot;，但是还是有很多网站换一种作弊方法继续作弊，因此，抓作弊成了一种长期的猫捉老鼠的游戏。虽然至今还没有一个一劳永逸地解决作弊问题的方法，但是，Google基本做到了对于任何已知的作弊方法，在一定时间内发现并清除它，从而总是将作弊的网站的数量控制在一个很小的比例范围。</p><p>抓作弊的方法很像信号处理中的去噪音的办法。学过信息论和有信号处理经验的读者可能知道这么一个事实，我们如果在发动机很吵的汽车里用手机打电话，对方可能听不清；但是如果我们知道了汽车发动机的频率，我们可以加上一个和发动机噪音相反的信号，很容易地消除发动机的噪音，这样，收话人可以完全听不到汽车的噪音。事实上，现在一些高端的手机已经有了这种检测和消除噪音的功能。消除噪音的流程可以概括如下：</p><p><a href="http://www.imkevinyang.com/wp-content/uploads/2009/03/clip-image0011.gif"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 10px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://www.imkevinyang.com/wp-content/uploads/2009/03/clip-image001-thumb1.gif" width="685" height="282" /></a></p><p>在图中，原始的信号混入了噪音，在数学上相当于两个信号做卷积。噪音消除的过程是一个解卷积的过程。这在信号处理中并不是什么难题。因为第一，汽车发动机的频率是固定的，第二，这个频率的噪音重复出现，只要采集几秒钟的信号进行处理就能做到。从广义上讲，只要噪音不是完全随机的、并且前后有相关性，就可以检测到并且消除。（事实上，完全随机不相关的高斯白噪音是很难消除的。）</p><p>搜索引擎的作弊者所作的事，就如同在手机信号中加入了噪音，使得搜索结果的排名完全乱了。但是，这种人为加入的噪音并不难消除，因为作弊者的方法不可能是随机的（否则就无法提高排名了）。而且，作弊者也不可能是一天换一种方法，即作弊方法是时间相关的。因此，搞搜索引擎排名算法的人，可以在搜集一段时间的作弊信息后，将作弊者抓出来，还原原有的排名。当然这个过程需要时间，就如同采集汽车发动机噪音需要时间一样，在这段时间内，作弊者可能会尝到些甜头。因此，有些人看到自己的网站经过所谓的优化（其实是作弊），排名在短期内靠前了，以为这种所谓的优化是有效的。但是，不久就会发现排名掉下去了很多。这倒不是搜索引擎以前宽容，现在严厉了，而是说明抓作弊需要一定的时间，以前只是还没有检测到这些作弊的网站而已。</p><p>还要强调一点，Google抓作弊和恢复网站原有排名的过程完全是自动的(并没有个人的好恶），就如同手机消除噪音是自动的一样。一个网站要想长期排名靠前，就需要把内容做好，同时要和那些作弊网站划清界限。</p><p>源文档 &lt;<a href="http://www.googlechinablog.com/2006/11/search-engine-anti-spam.html">http://www.googlechinablog.com/2006/11/search-engine-anti-spam.html</a>&gt;</p></ul>标签：<a href="http://www.imkevinyang.com/tags/google" title="Google" rel="tag">Google</a>, <a href="http://www.imkevinyang.com/tags/%e5%8f%8d%e4%bd%9c%e5%bc%8a" title="反作弊" rel="tag">反作弊</a>, <a href="http://www.imkevinyang.com/categories/greatpoststoshare" title="好文分享" rel="tag">好文分享</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/tags/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e" title="数学之美" rel="tag">数学之美</a>, <a href="http://www.imkevinyang.com/tags/%e7%b3%bb%e5%88%97%e6%96%87%e7%ab%a0" title="系列文章" rel="tag">系列文章</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/08/4%e8%a1%8cgreasemonkey%e4%bb%a3%e7%a0%81%e6%9c%80%e5%a4%a7%e5%8c%96google-reader%e7%9a%84%e9%98%85%e8%af%bb%e7%a9%ba%e9%97%b4.html" title="4行Greasemonkey代码最大化Google Reader的阅读空间 (2009/08/09)">4行Greasemonkey代码最大化Google Reader的阅读空间</a> (2009/08/09)</li><li><a href="http://www.imkevinyang.com/2010/03/android%e6%89%8b%e6%9c%ba%e5%88%9d%e4%bd%93%e9%aa%8c.html" title="Android手机初体验 (2010/03/01)">Android手机初体验</a> (2010/03/01)</li><li><a href="http://www.imkevinyang.com/2010/03/g1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html" title="G1手机与笔记本实现Wifi互联共享上网 (2010/03/02)">G1手机与笔记本实现Wifi互联共享上网</a> (2010/03/02)</li><li><a href="http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html" title="Google Analytics中的UniquePageView和Visits的区别 (2009/12/07)">Google Analytics中的UniquePageView和Visits的区别</a> (2009/12/07)</li><li><a href="http://www.imkevinyang.com/2009/11/google-wave%e4%b8%ba%e4%bb%80%e4%b9%88%e8%bf%99%e4%b9%88%e7%81%ab.html" title="Google Wave为什么这么火 (2009/11/14)">Google Wave为什么这么火</a> (2009/11/14)</li><li><a href="http://www.imkevinyang.com/2009/05/google%e5%92%8c%e5%be%ae%e8%bd%af%e7%9a%84%e4%b8%80%e5%a4%a7%e4%b8%8d%e5%90%8c.html" title="Google和微软的一大不同 (2009/05/06)">Google和微软的一大不同</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e6%8e%92%e5%90%8d%e6%9b%b4%e6%96%b0.html" title="Google排名更新 (2009/03/21)">Google排名更新</a> (2009/03/21)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e7%9a%84%e4%bb%b7%e5%80%bc%e8%a7%82.html" title="Google的价值观 (2009/03/07)">Google的价值观</a> (2009/03/07)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e5%8d%81%e4%b8%83-%e8%b0%88%e8%b0%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bd%9c%e5%bc%8a%e9%97%ae%e9%a2%98search-engine-anti-spam.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>数学之美系列五 &#8212; 简单之美：布尔代数和搜索引擎的索引</title><link>http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e4%ba%94-%e7%ae%80%e5%8d%95%e4%b9%8b%e7%be%8e%ef%bc%9a%e5%b8%83%e5%b0%94%e4%bb%a3%e6%95%b0%e5%92%8c%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html</link> <comments>http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e4%ba%94-%e7%ae%80%e5%8d%95%e4%b9%8b%e7%be%8e%ef%bc%9a%e5%b8%83%e5%b0%94%e4%bb%a3%e6%95%b0%e5%92%8c%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html#comments</comments> <pubDate>Thu, 26 Mar 2009 23:06:37 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[好文分享]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[布尔代数]]></category> <category><![CDATA[搜索引擎]]></category> <category><![CDATA[数学之美]]></category> <category><![CDATA[系列文章]]></category> <category><![CDATA[索引]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e4%ba%94-%e7%ae%80%e5%8d%95%e4%b9%8b%e7%be%8e%ef%bc%9a%e5%b8%83%e5%b0%94%e4%bb%a3%e6%95%b0%e5%92%8c%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html</guid> <description><![CDATA[<p>2006年5月10日 上午 09:10:00</p><p>发表者: 吴军，Google 研究员</p><p>[建立一个搜索引擎大致需要做这样几件事：自动下载尽可能多的网页；建立快速有效的索引；根据相关性对网页进行公平准确的排序。我们在介绍 <a href="http://googlechinablog.com/2006/02/page-rank-google.html">Google Page Rank</a> (网页排名) 时已经谈到了一些排序的问题，这里我们谈谈索引问题，以后我们还会谈如何度量网页的相关性，和进行网页自动下载。］</p><p>世界上不可能有比二进制更简单的计数方法了，也不可能有比布尔运算更简单的运算了。尽管今天每个&#8230;</p>]]></description> <content:encoded><![CDATA[<p>2006年5月10日 上午 09:10:00</p><p>发表者: 吴军，Google 研究员</p><p>[建立一个搜索引擎大致需要做这样几件事：自动下载尽可能多的网页；建立快速有效的索引；根据相关性对网页进行公平准确的排序。我们在介绍 <a href="http://googlechinablog.com/2006/02/page-rank-google.html">Google Page Rank</a> (网页排名) 时已经谈到了一些排序的问题，这里我们谈谈索引问题，以后我们还会谈如何度量网页的相关性，和进行网页自动下载。］</p><p>世界上不可能有比二进制更简单的计数方法了，也不可能有比布尔运算更简单的运算了。尽管今天每个搜索引擎都宣称自己如何聪明、多么智能化，其实从根本上讲都没有逃出布尔运算的框框。</p><p>布尔（George Boole) 是十九世纪英国一位小学数学老师。他生前没有人认为他是数学家。布尔在工作之余，喜欢阅读数学论著、思考数学问题。1854 年“思维规律”（An Investigation of the Laws of Thought, on which are founded the Mathematical Theories of Logic and Probabilities）一书，第一次向人们展示了如何用数学的方法解决逻辑问题。</p><p>布尔代数简单得不能再简单了。运算的元素只有两个1 （TRUE， 真) 和 0</p><p>（FALSE，假)。基本的运算只有“与”（AND)、“或” (OR) 和“非”（NOT) 三种（后来发现，这三种运算都可以转换成“与”“非” ＡＮＤ－ＮＯＴ一种运算）。全部运算只用下列几张真值表就能完全地描述清楚。</p><pre class="csharpcode">AND | 1 0

-----------------------

1 | 1 0

0 | 0 0</pre><p>这张表说明如果 AND 运算的两个元素有一个是 0，则运算结果总是 0。如果两个元素都是 1，运算结果是 1。例如，“太阳从西边升起”这个判断是假的(0),“水可以流动”这个判断是真的（1），那么，“太阳从西边升起并且水可以流动”就是假的（0）。</p><pre class="csharpcode">OR | 1 0

-----------------------

1 | 1 1

0 | 1 0</pre><p>这张表说明如果OR运算的两个元素有一个是 1，则运算结果总是 1。如果两个元素都是 0，运算结果是 0。比如说，“张三是比赛第一名”这个结论是假的（0），“李四是比赛第一名”是真的（1），那么“张三或者李四是第一名”就是真的（1）。</p><pre class="csharpcode">NOT |

--------------

1 | 0

0 | 1</pre><p>这张表说明 NOT 运算把 1 变成 0，把 0 变成 1。比如，如果“象牙是白的”是真的（1），那么“象牙不是白的”必定是假的（0）。</p><p>读者也许会问这么简单的理论能解决什么实际问题。布尔同时代的数学家们也有同样的问题。事实上在布尔代数提出后80 多年里，它确实没有什么像样的应用，直到 1938 年香农在他的硕士论文中指出用布尔代数来实现开关电路，才使得布尔代数成为数字电路的基础。所有的数学和逻辑运算，加、减、乘、除、乘方、开方等等，全部能转换成二值的布尔运算。</p><p>现在我们看看文献检索和布尔运算的关系。对于一个用户输入的关键词，搜索引擎要判断每篇文献是否含有这个关键词，如果一篇文献含有它，我们相应地给这篇文献一个逻辑值 -- 真（TRUE,或 1），否则，给一个逻辑值 -- 假（FALSE, 或0）。比如我们要找有关原子能应用的文献，但并不想知道如何造原子弹。我们可以这样写一个查询语句“原子能 AND 应用 AND (NOT 原子弹)”，表示符合要求的文献必须同时满足三个条件：</p><p>- 包含原子能</p><p>- 包含应用</p><p>- 不包含原子弹</p><p>一篇文献对于上面每一个条件，都有一个 True 或者 False 的答案，根据上述真值表就能算出每篇文献是否是要找的。</p><p>早期的文献检索查询系统大多基于数据库，严格要求查询语句符合布尔运算。今天的搜索引擎相比之下要聪明的多，它自动把用户的查询语句转换成布尔运算的算式。当然在查询时，不能将每篇文献扫描一遍，来看看它是否满足上面三个条件，因此需要建立一个索引。</p><p>最简单索引的结构是用一个很长的二进制数表示一个关键字是否出现在每篇文献中。有多少篇文献，就有多少位数，每一位对应一篇文献，1 代表相应的文献有这个关键字，0 代表没有。比如关键字“原子能”对应的二进制数是0100100001100001...，表示第二、第五、第九、第十、第十六篇文献包含着个关键字。注意，这个二进制数非常之长。同样，我们假定“应用”对应的二进制数是 0010100110000001...。那么要找到同时包含“原子能”和“应用”的文献时，只要将这两个二进制数进行布尔运算 AND。根据上面的真值表，我们知道运算结果是0000100000000001...。表示第五篇，第十六篇文献满足要求。</p><p>注意，计算机作布尔运算是非常非常快的。现在最便宜的微机都可以一次进行三十二位布尔运算，一秒钟进行十亿次以上。当然，由于这些二进制数中绝大部分位数都是零，我们只需要记录那些等于1的位数即可。于是，搜索引擎的索引就变成了一张大表：表的每一行对应一个关键词，而每一个关键词后面跟着一组数字，是包含该关键词 的文献序号。</p><p>对于互联网的搜索引擎来讲，每一个网页就是一个文献。互联网的网页数量是巨大的，网络中所用的词也非常非常多。因此这个索引是巨大的，在万亿字节这个量级。早期的搜索引擎（比如 Alta Vista 以前的所有搜索引擎），由于受计算机速度和容量的限制，只能对重要的关键的主题词建立索引。至今很多学术杂志还要求作者提供 3-5 个关键词。这样所有不常见的词和太常见的虚词就找不到了。现在，为了保证对任何搜索都能提供相关的网页，所有的搜索引擎都是对所有的词进行索引。为了网页排名方便，索引中还需存有大量附加信息，诸如每个词出现的位置、次数等等。因此，整个索引就变得非常之大，以至于不可能用一台计算机存下。大家普遍的做法就是根据网页的序号将索引分成很多份（Shards)，分别存储在不同的服务器中。每当接受一个查询时，这个查询就被分送到许许多多服务器中，这些服务器同时并行处理用户请求，并把结果送到主服务器进行合并处理，最后将结果返回给用户。</p><p>不管索引如何复杂，查找的基本操作仍然是布尔运算。布尔运算把逻辑和数学联系起来了。它的最大好处是容易实现，速度快，这对于海量的信息查找是至关重要的。它的不足是只能给出是与否的判断，而不能给出量化的度量。因此，所有搜索引擎在内部检索完毕后，都要对符合要求的网页根据相关性排序，然后才返回给用户。</p><p>源文档 &lt;<a href="http://www.googlechinablog.com/2006/05/blog-post_10.html">http://www.googlechinablog.com/2006/05/blog-post_10.html</a>&gt;</p>标签：<a href="http://www.imkevinyang.com/tags/google" title="Google" rel="tag">Google</a>, <a href="http://www.imkevinyang.com/categories/greatpoststoshare" title="好文分享" rel="tag">好文分享</a>, <a href="http://www.imkevinyang.com/tags/%e5%b8%83%e5%b0%94%e4%bb%a3%e6%95%b0" title="布尔代数" rel="tag">布尔代数</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/tags/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e" title="数学之美" rel="tag">数学之美</a>, <a href="http://www.imkevinyang.com/tags/%e7%b3%bb%e5%88%97%e6%96%87%e7%ab%a0" title="系列文章" rel="tag">系列文章</a>, <a href="http://www.imkevinyang.com/tags/%e7%b4%a2%e5%bc%95" title="索引" rel="tag">索引</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/08/4%e8%a1%8cgreasemonkey%e4%bb%a3%e7%a0%81%e6%9c%80%e5%a4%a7%e5%8c%96google-reader%e7%9a%84%e9%98%85%e8%af%bb%e7%a9%ba%e9%97%b4.html" title="4行Greasemonkey代码最大化Google Reader的阅读空间 (2009/08/09)">4行Greasemonkey代码最大化Google Reader的阅读空间</a> (2009/08/09)</li><li><a href="http://www.imkevinyang.com/2010/03/android%e6%89%8b%e6%9c%ba%e5%88%9d%e4%bd%93%e9%aa%8c.html" title="Android手机初体验 (2010/03/01)">Android手机初体验</a> (2010/03/01)</li><li><a href="http://www.imkevinyang.com/2010/03/g1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html" title="G1手机与笔记本实现Wifi互联共享上网 (2010/03/02)">G1手机与笔记本实现Wifi互联共享上网</a> (2010/03/02)</li><li><a href="http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html" title="Google Analytics中的UniquePageView和Visits的区别 (2009/12/07)">Google Analytics中的UniquePageView和Visits的区别</a> (2009/12/07)</li><li><a href="http://www.imkevinyang.com/2009/11/google-wave%e4%b8%ba%e4%bb%80%e4%b9%88%e8%bf%99%e4%b9%88%e7%81%ab.html" title="Google Wave为什么这么火 (2009/11/14)">Google Wave为什么这么火</a> (2009/11/14)</li><li><a href="http://www.imkevinyang.com/2009/05/google%e5%92%8c%e5%be%ae%e8%bd%af%e7%9a%84%e4%b8%80%e5%a4%a7%e4%b8%8d%e5%90%8c.html" title="Google和微软的一大不同 (2009/05/06)">Google和微软的一大不同</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e6%8e%92%e5%90%8d%e6%9b%b4%e6%96%b0.html" title="Google排名更新 (2009/03/21)">Google排名更新</a> (2009/03/21)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e7%9a%84%e4%bb%b7%e5%80%bc%e8%a7%82.html" title="Google的价值观 (2009/03/07)">Google的价值观</a> (2009/03/07)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/03/%e6%95%b0%e5%ad%a6%e4%b9%8b%e7%be%8e%e7%b3%bb%e5%88%97%e4%ba%94-%e7%ae%80%e5%8d%95%e4%b9%8b%e7%be%8e%ef%bc%9a%e5%b8%83%e5%b0%94%e4%bb%a3%e6%95%b0%e5%92%8c%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>免费的SEO检测工具</title><link>http://www.imkevinyang.com/2009/03/%e5%85%8d%e8%b4%b9%e7%9a%84seo%e6%a3%80%e6%b5%8b%e5%b7%a5%e5%85%b7.html</link> <comments>http://www.imkevinyang.com/2009/03/%e5%85%8d%e8%b4%b9%e7%9a%84seo%e6%a3%80%e6%b5%8b%e5%b7%a5%e5%85%b7.html#comments</comments> <pubDate>Sun, 22 Mar 2009 07:37:00 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[好文分享]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[免费]]></category> <category><![CDATA[工具]]></category> <category><![CDATA[排名检测]]></category> <category><![CDATA[搜索引擎]]></category> <category><![CDATA[网站统计]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/03/%e5%85%8d%e8%b4%b9%e7%9a%84seo%e6%a3%80%e6%b5%8b%e5%b7%a5%e5%85%b7.html</guid> <description><![CDATA[<p>1.<a href="http://seodigger.com/">SEO Digger</a> [ 关键词查询, 排名查询 ] - 检测你站点中已经有比较好排名的关键词，并可以查看他们排名的位置。我想，这个挺重要的，特别是对于那些对关键词并不敏感的人。</p><p>2.<a href="http://www.quarkbase.com/">Quark Base</a> [ 完美的网站统计] - 给你一个站的需要的全部信息。从IP到页面排名，维基百科链接，等。并可以对比与你竞争的网站，来找出自己的不足。</p><p>3.<a href="http://www.seometer.com/">SEO Meter</a> [ Google ] - 测试Google对你站点抓取的频率。</p><p>4.<a href="http://www.siteyogi.com/">SiteYogi</a> [ 网站健康查询 ] - 查看你的站&#8230;</p>]]></description> <content:encoded><![CDATA[<p>1.<a href="http://seodigger.com/">SEO Digger</a> [ 关键词查询, 排名查询 ] - 检测你站点中已经有比较好排名的关键词，并可以查看他们排名的位置。我想，这个挺重要的，特别是对于那些对关键词并不敏感的人。</p><p>2.<a href="http://www.quarkbase.com/">Quark Base</a> [ 完美的网站统计] - 给你一个站的需要的全部信息。从IP到页面排名，维基百科链接，等。并可以对比与你竞争的网站，来找出自己的不足。</p><p>3.<a href="http://www.seometer.com/">SEO Meter</a> [ Google ] - 测试Google对你站点抓取的频率。</p><p>4.<a href="http://www.siteyogi.com/">SiteYogi</a> [ 网站健康查询 ] - 查看你的站点在各种搜索引擎和社会化媒体中的统计，等。不过，有时数据不是很准确。</p><p>5.<a href="http://www.xinureturns.com/">Xinu Returns</a> [ 网站统计查询] - 测试包括DiGG，维基百科链入情况，及反向链接等的情况。</p><p>6.<a href="http://www.siterake.com/">Site Rake</a> [ 日志分析] - 上传你的网站日志（是LOG，不是日记，文章，而是使用记录），这个站分帮你分析。</p><p>7.<a href="http://www.websitegrader.com/">Website Grader</a> [ SEO网站统计查询] - 测试所有从来链到关键词分析等内容。</p><p>8.<a href="http://www.urltrends.com/">URL Trends</a> [ SEO网站统计查询 ] - 免费的SEO报告，包括社会化书签的内链，用户数统计，关键词分析，链放链接，流量统计等。</p><p>9.<a href="http://www.urlmetrix.com/">URL Metrix</a> [ 网站统计查询] - 其于SEO的所有基本信息，比如Google索引的页面，反向链接数等。</p><p>10.<a href="http://whoistoolbox.com/SEO-Tools/multiple-keyword-se-position/">Multiple keywords rank Check</a> [ 网站统计查询] - 多个关键词的排名情况查询。</p><p>11.<a href="http://www.check-seo.com/InternalPagerankChecker.php">Internal Pages PR checker</a> [ Page Rank 查询 ] - 查看你所有内部页面的 Page Rank。对了解自己的网站结构非常有用。</p><p>12.<a href="http://www.exactfactor.com/">Exact Factor</a> [ 排名检测 ] - 测试不同站点在Google/Yahoo中的排名情况。</p>标签：<a href="http://www.imkevinyang.com/tags/seo" title="SEO" rel="tag">SEO</a>, <a href="http://www.imkevinyang.com/tags/%e5%85%8d%e8%b4%b9" title="免费" rel="tag">免费</a>, <a href="http://www.imkevinyang.com/categories/greatpoststoshare" title="好文分享" rel="tag">好文分享</a>, <a href="http://www.imkevinyang.com/tags/%e5%b7%a5%e5%85%b7" title="工具" rel="tag">工具</a>, <a href="http://www.imkevinyang.com/tags/%e6%8e%92%e5%90%8d%e6%a3%80%e6%b5%8b" title="排名检测" rel="tag">排名检测</a>, <a href="http://www.imkevinyang.com/tags/%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e" title="搜索引擎" rel="tag">搜索引擎</a>, <a href="http://www.imkevinyang.com/tags/%e7%bd%91%e7%ab%99%e7%bb%9f%e8%ae%a1" title="网站统计" rel="tag">网站统计</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/05/2009%e5%b9%b4%e7%ac%ac%e4%b8%80%e5%ad%a3%e5%ba%a6%e4%b8%ad%e5%9b%bd%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e5%b8%82%e5%9c%ba%e8%90%a5%e6%94%b6%e4%bb%bd%e9%a2%9d.html" title="2009年第一季度中国搜索引擎市场营收份额 (2009/05/06)">2009年第一季度中国搜索引擎市场营收份额</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2009/05/robotstxt%e6%96%87%e4%bb%b6.html" title="Robots.txt文件 (2009/05/06)">Robots.txt文件</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html" title="Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO) (2010/05/04)">Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO)</a> (2010/05/04)</li><li><a href="http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html" title="Silverlight SEO（搜索引擎优化）白皮书 (2009/04/06)">Silverlight SEO（搜索引擎优化）白皮书</a> (2009/04/06)</li><li><a href="http://www.imkevinyang.com/2009/11/%e3%80%90%e6%8e%a8%e8%8d%90%e3%80%91%e4%b8%a4%e6%ac%behttp%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90%e5%b7%a5%e5%85%b7%e7%9a%84%e6%af%94%e8%be%83.html" title="【推荐】两款HTTP流量分析工具的比较 (2009/11/08)">【推荐】两款HTTP流量分析工具的比较</a> (2009/11/08)</li><li><a href="http://www.imkevinyang.com/2009/07/%e4%b8%bawordpress%e5%8d%9a%e5%ae%a2%e5%8a%a0%e9%80%9f%e6%b8%85%e7%90%86%e4%bd%a0%e7%9a%84%e4%b8%bb%e9%a2%98%e6%96%87%e4%bb%b6.html" title="为Wordpress博客加速&mdash;&mdash;清理你的主题文件 (2009/07/26)">为Wordpress博客加速&mdash;&mdash;清理你的主题文件</a> (2009/07/26)</li><li><a href="http://www.imkevinyang.com/2009/08/%e5%8d%9a%e5%ae%a2%e7%a9%ba%e9%97%b4%e8%bf%81%e7%a7%bb%e4%b8%89%e6%ad%a5%e8%b5%b0.html" title="博客空间迁移三步走 (2009/08/21)">博客空间迁移三步走</a> (2009/08/21)</li><li><a href="http://www.imkevinyang.com/2009/03/%e5%90%84%e5%a4%a7%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e6%94%b6%e5%bd%95%e5%85%a5%e5%8f%a3.html" title="各大搜索引擎收录入口 (2009/03/21)">各大搜索引擎收录入口</a> (2009/03/21)</li><li><a href="http://www.imkevinyang.com/2009/12/%e5%9c%a8wordpress%e4%b8%ad%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e.html" title="在Wordpress中轻松集成Google自定义搜索引擎 (2009/12/07)">在Wordpress中轻松集成Google自定义搜索引擎</a> (2009/12/07)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/03/%e5%85%8d%e8%b4%b9%e7%9a%84seo%e6%a3%80%e6%b5%8b%e5%b7%a5%e5%85%b7.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>