我打算实现一个谷歌网站搜索(并为它付出,所以我可以访问XML)。有一两件事我想知道的是可能在它使用自定义的meta标签。

我是从同事那里听说过,但没有证实。寻找答案给了什么(也许是因为你不能?)

任何人都知道?

修改:我希望能够检索从搜索结果的meta标签,能够为不同类型的页面提供不同的造型

有帮助吗?

解决方案

是的,你可以做到这一点,虽然没有,据我所知,使用元标签。相反,谷歌允许你把你的HTML,然后可以从您从谷歌自定义搜索找回XML检索中的自定义属性的结果API。

看看 http://code.google.com/apis/customsearch/docs/snippets.html 对这个如何工作的更多信息。该结构化数据部分概述了具体的方法你能坚持自定义元数据你的页面中,以便谷歌将交回给你与每个搜索结果一起。最简单的似乎是一个页映射,这是你脑袋里的HTML注释,如下所示:

  <!-- 
  <PageMap> 
     <DataObject type="document"> 
        <Attribute name="title">The Biomechanics of a Badminton Smash</Attribute> 
        <Attribute name="author">Avelino T. Lim</Attribute> 
        <Attribute name="description">The smash is the most explosive and aggressive stroke in Badminton.  
                                      Elite athletes can generate shuttlecock velocities of up to 370 km/h.  
                                      To perform the stroke, one must understand the biomechanics involved,  
                                      from the body positioning to the wrist flexion. </Attribute>                                       
        <Attribute name="page_count">25</Attribute> 
        <Attribute name="rating">4.5</Attribute> 
        <Attribute name="last_update">05/05/2009</Attribute> 
        <Attribute name="thumbnail">http://www.example.com/papers/sic.png" width="627" height="167" /> 
     </DataObject> 
  </PageMap> 
  -->  

如果你绝对必须使用META标签中, Bing搜索API 不支持索引所有的meta标签name属性开头“搜索”,如

<meta name="Search.MyCustomProp" content="Hola mi amigo Google, I want my META!">

然后,在冰结果API可以使用拔出所有这些值的 WebResult.SearchTag property 。当发出请求,你要么需要 WebRequest.SearchTags Property 或可以只是文本添加到您的搜索查询,例如, poodle meta:search.MyCustomProp(amigo)搜索网页上,其中search.MyCustomProp meta标签包含单词“朋友”这个词“狮子狗”。使用必应API是免费的,只要你保持在每秒,坚持7个查询详细的一些其他限制的此处

抱歉要谈这么多兵,随意忽略part--但我有使用必应API在以前的工作相当积极的经验。

其他提示

您能详细了解meta标签要使用。您可以添加meta标签,它不应该不管谷歌。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top