<?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>dansion's 日志 &#187; opensearch</title>
	<atom:link href="http://www.dansion.com/blog/tag/opensearch/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dansion.com/blog</link>
	<description>学无止境～～～～～～～</description>
	<lastBuildDate>Sat, 06 Feb 2010 09:08:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>opensearch让你网站的搜索搬到浏览器</title>
		<link>http://www.dansion.com/blog/uncategorized/opensearch-for-ie8-and-ff.html</link>
		<comments>http://www.dansion.com/blog/uncategorized/opensearch-for-ie8-and-ff.html#comments</comments>
		<pubDate>Mon, 18 May 2009 17:49:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[ff]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[opensearch]]></category>
		<category><![CDATA[网站]]></category>

		<guid isPermaLink="false">http://www.dansion.com/blog/?p=631</guid>
		<description><![CDATA[opensearch,分享搜寻结果的简单的格式。IE7+,以及FF2+都支持。让你网站的搜索服务搬到浏览器上面，不管实用不实用，反正不是很难，不防给网站加上。
一.创建opensearch.
1.可以能管IE8的专门网站www.ideadons.com创建
&#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243; ?&#62; 
&#60;OpenSearchDescription xmlns=&#8221;http://a9.com/-/spec/opensearch/1.1/&#8221;&#62;
&#60;ShortName&#62;搜索名称&#60;/ShortName&#62; 
&#60;Description&#62;搜索描述&#60;/Description&#62; 
&#60;InputEncoding&#62;UTF-8&#60;/InputEncoding&#62;  //输入编码
&#60;Url type=&#8221;text/html&#8221; template=&#8221;http://www.dansion.com/blog/q={searchTerms}&#8221; /&#62; //搜索的地址,其中{searchTerms}是用户浏览器输入的
&#60;/OpenSearchDescription&#62;
这是最简单的一个opensearch.还可以增加一些输入的建议的功能。
&#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243; ?&#62; 
&#60;OpenSearchDescription xmlns=&#8221;http://a9.com/-/spec/opensearch/1.1/&#8221;&#62;
&#60;ShortName&#62;搜索名称&#60;/ShortName&#62; 
&#60;Description&#62;搜索描述&#60;/Description&#62; 
&#60;Contact&#62;联系(邮件地址)&#60;/Contact&#62; 
&#60;Url type=&#8221;text/html&#8221; method=&#8221;get&#8221; template=&#8221;http://www.yoursite.com/search?q={searchTerms}&#8221; /&#62; //搜索结果
&#60;Url type=&#8221;application/x-suggestions+xml&#8221; template=&#8221;http://www.yoursite.com/suggest/ie.s?query={searchTerms}&#8221; /&#62; //输入关健字建议,输入联想
&#60;Url type=&#8221;application/x-suggestions+json&#8221; method=&#8221;GET&#8221; template=&#8221;http://www.yoursite.com/suggest/js.s?query={searchTerms}&#8221; /&#62; //输入关健字建议,输入联想,针对FF
&#60;Image height=&#8221;16&#8243; width=&#8221;16&#8243; type=&#8221;image/icon&#8221;&#62;http://www.yoursite.com/favicon.ico&#60;/Image&#62; 
&#60;LongName&#62;长名字&#60;/LongName&#62; 
&#60;Developer&#62;开发者&#60;/Developer&#62; 
&#60;Attribution&#62;归属&#60;/Attribution&#62; 
&#60;SyndicationRight&#62;open&#60;/SyndicationRight&#62; //默认open,还有limited,private,closed
&#60;AdultContent&#62;false&#60;/AdultContent&#62; //是否仅对成人
&#60;Language&#62;en-us&#60;/Language&#62;
&#60;OutputEncoding&#62;UTF8&#60;/OutputEncoding&#62; //输出编码
&#60;InputEncoding&#62;UTF8&#60;/InputEncoding&#62; //输入编码
&#60;/OpenSearchDescription&#62;
opensearch 详细的标签说明 
输入提示的XML格式如下
&#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF8&#8243; ?&#62;
&#60;SearchSuggestion version=&#8221;2.0&#8243; xmlns=&#8221;http://opensearch.org/searchsuggest2&#8243;&#62;
&#60;Query&#62;输入关健字&#60;/Query&#62;
&#60;Section title=&#8221;Yodao Web Search Suggestion&#8221;&#62;
&#60;Item&#62;
&#60;Text&#62;相关提示&#60;/Text&#62;
&#60;/Item&#62;
&#60;/Section&#62;
&#60;/SearchSuggestion&#62;
json格式如下:
["输入关健字",["相关提示","相关提示","相关提示"]]
输入提示还可以更丰富，比如还可以增加图片，描述，链接，例如淘宝那样.
更多详情标签格式.
二.如何添加或让用户知道
创建并上传opensearch XML文件到到你的网站，再在需要提示的页面增加html头部添加以下代码。
&#60;link rel=&#8221;search&#8221; type=&#8221;application/opensearchdescription+xml&#8221; href=&#8221;http://www.yoursite.com/search.xml&#8221; title=&#8221;搜索名字&#8221; /&#62;
这种方式只会在浏览器搜索框有提示，不过不明显。
还可以提供按扭让用户安装的js方法如下：（该js来自:https://developer.mozilla.org)
function installSearchEngine() {
 if (window.external &#38;&#38; [...]]]></description>
		<wfw:commentRss>http://www.dansion.com/blog/uncategorized/opensearch-for-ie8-and-ff.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
