Created
May 6, 2012 20:31
-
-
Save nfriedly/2624238 to your computer and use it in GitHub Desktop.
DDGG: Duck Duck Go + Google Suggest in Danish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> | |
<ShortName>Duck Duck Go + Google Suggest</ShortName> | |
<Description>Duck Duck Go + Google Suggest</Description> | |
<Image height="16" width="16" type="image/x-icon">http://duckduckgo.com/favicon.ico</Image> | |
<Url type="text/html" method="get" template="http://duckduckgo.com/?q={searchTerms}"/> | |
<Url type="application/x-suggestions+json" template="http://google.com/complete/search?output=firefox&q={searchTerms}&hl=da"/> | |
<Url rel="suggestions" type="application/x-suggestions+xml" template="http://google.com/complete/search?q={searchTerms}&client=ie8&mw={ie:maxWidth}&sh={ie:sectionHeight}&rh={ie:rowHeight}&inputencoding={inputEncoding}&outputencoding={outputEncoding}&hl=da" /> | |
</OpenSearchDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Danish Duck Duck Go + Google Suggest OpenSearch Plugin</title> | |
<link rel="search" id="xml-direct" type="application/opensearchdescription+xml" title="Direct Duck Duck Go + Google Suggest (Danish)" href="https://raw.github.com/gist/2624238/b3a4c9219df6ad575a60286fe80a7b8ea8c9a673/ddg-google-da.xml" > | |
</head> | |
<body> | |
<h1>Danish Duck Duck Go + Google Suggest OpenSearch Plugin</h1> | |
<p>Install via the search box or <a href="#">click here</a>.</p> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
function installSearchEngine(url) { | |
if (window.external && ("AddSearchProvider" in window.external)) { | |
window.external.AddSearchProvider( url ); | |
} else { | |
alert("your browser doesn't appear to support installing opensearch plugins via javascript"); | |
} | |
} | |
$(document).ready(function(){ | |
$('a').click(function(){ | |
installSearchEngine( $('#xml-direct').attr("href") ); | |
}); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usable example at http://nfriedly.com/stuff/ddgg-da/