<?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>LiquidFoot &#187; opensearch</title>
	<atom:link href="http://www.liquidfoot.com/tag/opensearch/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.liquidfoot.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 02 Jan 2012 22:56:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Sherlock/OpenSearch Plugins for Libraries</title>
		<link>http://www.liquidfoot.com/2009/01/15/sherlockopensearch-plugins-for-libraries/</link>
		<comments>http://www.liquidfoot.com/2009/01/15/sherlockopensearch-plugins-for-libraries/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 19:34:12 +0000</pubDate>
		<dc:creator>Wayne</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[opensearch]]></category>
		<guid isPermaLink="false">http://www.liquidfoot.com/?p=240</guid>
		<description><![CDATA[Back in the day, I used to work on the <a href="http://mycroft.mozdev.org/">Mycroft Project</a>. At the time, only Firefox/Netscape could actually used these plugins as they were based on Apple's Sherlock specification (Mycroft is Sherlock Holmes' brother, btw). These plugins have been a staple in the Firefox browser, but the Sherlock spec was a little arcane. More recently, both Firefox and IE have implemented support for the <a href="http://www.opensearch.org/Home">OpenSearch specification</a>. I have to say that the OpenSearchDescription is a significant update (at least from a readability standpoint) than Sherlock.]]></description>
			<content:encoded><![CDATA[<p>Back in the day, I used to work on the <a href="http://mycroft.mozdev.org/">Mycroft Project</a>. At the time, only Firefox/Netscape could actually used these plugins as they were based on Apple&#8217;s Sherlock specification (Mycroft is Sherlock Holmes&#8217; brother, btw). These plugins have been a staple in the Firefox browser, but the Sherlock spec was a little arcane. More recently, both Firefox and IE have implemented support for the <a href="http://www.opensearch.org/Home">OpenSearch specification</a>. I have to say that the OpenSearchDescription is a significant update (at least from a readability standpoint) than Sherlock.</p>
<p>A few years ago, I had written a bunch of Sherlock plugins for <a href="http://swem.wm.edu/resources/tools/">searching various library</a> catalogs. Those pretty much lay dormant until I was talking with my student worker this last semester and he got quite excited about these, and wondered if there might be a way to also search the databases the library subscribes to, and provide off-campus access to these through our proxy server. This code is in a very basic stage right now, but essentially what I did was create a database driven application in PHP that generates OpenSearch XML for various targets to search against.</p>
<p>Right now, this only supports HTTP GET requests (POST parameters require an additional table), but here&#8217;s the DDL:</p>
<pre name="code" class="sql">CREATE TABLE `plugins` (
  `id` char(36) NOT NULL,
  `short_name` varchar(50) NOT NULL,
  `description` varchar(255) NOT NULL,
  `engine` varchar(25) NOT NULL,
  `image` varchar(25) NOT NULL,
  `input_encoding` varchar(10) NOT NULL,
  `url` varchar(550) NOT NULL,
  `method` varchar(4) NOT NULL default 'get',
  `proxy` tinyint(1) NOT NULL default '1',
  KEY `engine_index` (`engine`),
  KEY `short_name_index` (`short_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1</pre>
<p>You don&#8217;t need all of these fields for every record, and here is some useful records&#8230;</p>
<pre name="code" class="sql">INSERT INTO plugins (id, short_name, engine, input_encoding, method, proxy, url)
VALUES (UUID(), ' JStor', 'jstor', 'UTF-8', 'get', 1, 'http://www.jstor.org/action/doBasicSearch?Query=');
INSERT INTO plugins (id, short_name, engine, input_encoding, method, proxy, url)
VALUES (UUID(), 'Google Your University', 'google', 'UTF-8', 'get', 1, 'http://www.google.com/univ/wm?hl=en&amp;ie=ISO-8859-1&amp;btnG=Google+Search&amp;q=');
INSERT INTO plugins (id, short_name, engine, input_encoding, method, proxy, url)
VALUES (UUID(), 'Google Scholar', 'googlescholar', 'UTF-8', 'get', 1, 'http://scholar.google.com/scholar?&amp;hl=en&amp;lr=&amp;btnG=Search&amp;q=');
INSERT INTO plugins (id, short_name, engine, input_encoding, method, proxy, url)
VALUES (UUID(), 'Ebrary', 'ebrary', 'UTF-8', 'get', 1, 'http://site.ebrary.com/lib//Top?layout=search&amp;nosr=1&amp;sch=sch&amp;frm=smp.x&amp;p00=');
INSERT INTO plugins (id, short_name, engine, input_encoding, method, proxy, url)
VALUES (UUID(), 'EbscoHost', 'ebsco', 'UTF-8', 'get', 1, 'http://search.ebscohost.com/login.aspx?db=aph&amp;direct=true&amp;bQuery=');
INSERT INTO plugins (id, short_name, engine, input_encoding, method, proxy, url)
VALUES (UUID(), 'LexisNexis', 'lexisnexis', 'UTF-8', 'get', 1, 'http://www.lexisnexis.com/us/lnacademic/search/homesubmitForm.do');
INSERT INTO plugins (id, short_name, engine, input_encoding, method, proxy, url)
VALUES (UUID(), 'Proquest UMI', 'umi', 'UTF-8', 'get', 1, 'http://proquest.umi.com/pqdweb?RQT=305&amp;FT=1&amp;DBId=414&amp;SQ=');
INSERT INTO plugins (id, short_name, engine, input_encoding, method, proxy, url)
VALUES (UUID(), 'Science Direct', 'sciencedirect', 'UTF-8', 'get', 1, 'http://www.sciencedirect.com/science/quicksearch?query=');</pre>
<p>Apparently I wrote the queries with MDB2, I&#8217;ve since moved most of my interactions to Zend Db (you should be able to write that part pretty quickly) and just dump the names of the plugins in the tableon a view:</p>
<pre name="code" class="php">foreach($plugins as $plugin):
    echo('&amp;lt;li&amp;gt;' . $plugin['short_name'] . ': ');
       echo(' &amp;lt;a href="openSearch.php?id=' . $plugin['id'] . '"&amp;gt;&amp;lt;img src="images/a9.png" title="OpenSearch" /&amp;gt;&amp;lt;/a&amp;gt;');
        if(strlen($plugin['url']) &amp;gt; 0){
        	echo(' &amp;lt;a href="search.php?engine=' . $plugin['engine'] . '&amp;q=regulators"&amp;gt;test search');
            echo(' | &amp;lt;a href="#" title="Ref: ' . $plugin['engine'] . '" onClick="addOpenSearch(\'' . $plugin['engine'] . '\', \'gif\', \'Education\', \'' . $plugin['id'] . '\'); return false;"&amp;gt;add&amp;lt;/a&amp;gt;');
        }
        echo('&amp;lt;/li&amp;gt;);
');
endforeach;</pre>
<p>The add code is straight-forward</p>
<pre name="code" class="php">$result = $result[0];
$short_name = $result['short_name'];
$description = $result['description'];
$engine = $result['engine'];
$id = $result['id'];
$xml = &amp;lt;&amp;lt;&amp;lt;EOT
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/"&amp;gt;
&amp;lt;ShortName&amp;gt;$short_name&amp;lt;/ShortName&amp;gt;
&amp;lt;Description&amp;gt;$description&amp;lt;/Description&amp;gt;
&amp;lt;Url type="text/html" method="get" template="http://&amp;lt;your_server&amp;gt;/plugins/proxy.php?engine=$engine&amp;q="/&amp;gt;
&amp;lt;Contact&amp;gt;libsys@wm.edu&amp;lt;/Contact&amp;gt;
&amp;lt;Image width="16" height="16"&amp;gt;http://&amp;lt;your_server&amp;gt;/favicon.ico&amp;lt;/Image&amp;gt;
&amp;lt;Developer&amp;gt;Wayne Graham&amp;lt;/Developer&amp;gt;
&amp;lt;InputEncoding&amp;gt;UTF-8&amp;lt;/InputEncoding&amp;gt;
&amp;lt;moz:SearchForm&amp;gt;http://&amp;lt;your_server&amp;gt;/plugins/search.php?engine=$engine&amp;lt;/moz:SearchForm&amp;gt;
&amp;lt;moz:UpdateUrl&amp;gt;http://&amp;lt;your_server&amp;gt;/plugins/opensearch.php?$id&amp;lt;/moz:UpdateUrl&amp;gt;
&amp;lt;moz:IconUpdateUrl&amp;gt;http://swem.wm.edu/favicon.ico&amp;lt;/moz:IconUpdateUrl&amp;gt;
&amp;lt;moz:UpdateInterval&amp;gt;7&amp;lt;/moz:UpdateInterval&amp;gt;
&amp;lt;/OpenSearchDescription&amp;gt;
EOT;
header("Content-Type: text/xml");
echo($xml);</pre>
<p>You just need a little JavaScript to add this in to IE and Firefox:</p>
<pre name="code" class="JavaScript">
function addOpenSearch(name,ext,cat,pid,meth)
{
  if ((typeof window.external == "object") &#038;&#038; ((typeof window.external.AddSearchProvider == "unknown") || (typeof window.external.AddSearchProvider == "function"))) {
    // See bugs 430058/430067/430070 for Camino
    if (((typeof window.external.AddSearchProvider == "unknown") || (window.navigator.vendor == 'Camino'))&#038;&#038; meth == "p") {
      alert("This plugin uses POST which is not currently supported by your browser's implementation of OpenSearch.");
    } else {
      window.external.AddSearchProvider("http://<your_server>/plugins/install.php?id=" + pid);
    }
  } else {
    alert("You will need a browser which supports OpenSearch to install this plugin.");
  }
}
</pre>
<p>If I get some time soon, I&#8217;ll wrap this up into a package; rudimentary, but a decent start to your own app!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.liquidfoot.com/2009/01/15/sherlockopensearch-plugins-for-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Search</title>
		<link>http://www.liquidfoot.com/2008/11/06/open-search/</link>
		<comments>http://www.liquidfoot.com/2008/11/06/open-search/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 16:32:45 +0000</pubDate>
		<dc:creator>Wayne</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[opensearch]]></category>
		<guid isPermaLink="false">http://www.liquidfoot.com/?p=116</guid>
		<description><![CDATA[It&#8217;s been a while since I last posted, but the NEH Slave Quarters project is coming to a close and the next grant is out the door (to build a digital archive of the newspaper articles of Elizabeth Stoddard). So I showed my student worker the search plugins I had made a few years ago [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I last posted, but the NEH Slave Quarters project is coming to a close and the next grant is out the door (to build a digital archive of the newspaper articles of Elizabeth Stoddard).</p>
<p>So I showed my student worker the search plugins I had made a few years ago and he got really excited. They&#8217;re burried on our website right now (but then again, so is everything), but he like the convienence. He actually got me to start thinking about it a bit more. IE 7 and Firefox both use OpenSearch now for their search plugins. There&#8217;s not a whole lot to this description (and it&#8217;s a lot more convienent than the Sherlock format). What if I built a quick app that could generate the XML for these and them people could install them? We could quickly develop a collection of useful plugins that would help folks get to data (hopefully) faster.</p>
<p>I started looking at it yesterday and it&#8217;s pretty straight forward&#8230;with a few exceptions. Most search engines use a get method, but I&#8217;m finding a bunch of our most popular search engine providers (e.g. lexisnexis, factiva, etc.) use a post method with weird session variables.</p>
<p>Focusing on just the &#8220;easy&#8221; stuff first, I wrote a database table (which is still in flux) that recorded the basic OpenSearch fields first: short_name, description, input_encoding, and url. I populated the fields with some basic search engines that folks use here at William and Mary: all the libraries, Google Scholar, Ebrary, JStor, EbscoHost, ScienceDirect, and our federated searching engine). I wrote a search proxy to rewrite the search URLs, though it&#8217;s really not necessary (and I may change that).</p>
<p>Since I got on the kick, I figured I&#8217;d write something up real quick for Vufind too. By adding a few lines of code, folks will be able to add the Vufind instance to their search list without doing much!</p>
<p>After I get the code a bit cleaner, and work through some of the other &#8220;issues&#8221; with search providers who use &#8216;POST&#8217; for queries, I&#8217;ll add some code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.liquidfoot.com/2008/11/06/open-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

