opensearch
I was over at http://search.twitter.com earlier today and I noticed the Search Box in Firefox had a blue lit-up dealie:
我今天早些时候在http://search.twitter.com结束了,我注意到Firefox中的搜索框有一个蓝色的亮点。
Hm...OK. What's that? I hit another site and didn't see it. Weird. Ok, View-Source then, what drives you little blue thing?
嗯...好。 那是什么? 我访问了另一个网站,但没有看到它。 奇怪的。 好吧,那么查看源代码,是什么促使您感到沮丧呢?
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Twitter Search">
Hey, that's not something I've seen before. What's in it...http://search.twitter.com/opensearch.xml...
嘿,那不是我以前见过的东西。 里面有什么... http://search.twitter.com/opensearch.xml ...
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Twitter Search</ShortName>
<Description>Realtime Twitter Search</Description>
<Url type="text/html" method="get" template="http://search.twitter.com/search?q={searchTerms}"/>
<Image width="16" height="16">http://search.twitter.com/favicon.png</Image>
<InputEncoding>UTF-8</InputEncoding>
<SearchForm>http://search.twitter.com/</SearchForm>
</OpenSearchDescription>
Ah! I totally get it. Excellent. I shall make my own immediately! I added this file to my website and added a <link> line as seen in the first example above that pointed to it.
啊! 我完全明白。 优秀的。 我将立即做自己的! 我将此文件添加到我的网站,并添加了<link>行,如在上面的第一个示例中所指向的。
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Hanselman Search</ShortName>
<Description>Search Scott Hanselman's Blog</Description>
<Url type="text/html" method="get" template="http://www.hanselman.com/blog/...snip...q={searchTerms}"/>
<Image width="16" height="16">http://www.hanselman.com/blog/favicon.ico</Image>
<InputEncoding>UTF-8</InputEncoding>
<SearchForm>http://www.hanselman.com/</SearchForm>
</OpenSearchDescription>
Bam.
am
I wonder if it works in IE7?
我想知道它是否可以在IE7中使用吗?
Pow! I wonder if Live.com supports it?
ow! 我想知道Live.com是否支持它?
Eek! FAIL. I'll mention that to someone at Live.com
ek! 失败。 我会在Live.com上向某人提及
OpenSearch is a really easy feature that you can add to your website in literally minutes. Seconds if you type fast. Check me out noticing this only three years late. :)
OpenSearch是一项非常简单的功能,您可以在几分钟内将其添加到您的网站。 快速输入秒数。 让我注意一下,发现这仅晚了三年。 :)
Give it a try!
试一试!
IMPORTANT NOTES: Make sure you include the first line of the XML file (the XML declaration) or IE will ignore it and nothing will happen when you add it. Also, make sure you include the default XML namespace or Firefox will give you an error: "Firefox could not download the search plugin"
重要说明:确保包括XML文件的第一行(XML声明),否则IE将忽略它,并且在添加时什么也不会发生。 另外,请确保您包括默认的XML名称空间,否则Firefox将给您一个错误:“ Firefox无法下载搜索插件”
opensearch