Created
April 7, 2010 19:44
-
-
Save jmatt/359342 to your computer and use it in GitHub Desktop.
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
// Source: http://gist.github.com/180078 | |
// original author: { name: "Ricardo Niederberger Cabral", email: "ricardo@isnotworking.com"} | |
var noun_type_article = { | |
_name: "anything", | |
suggest: function( text, html ) { | |
var suggestions = [CmdUtils.makeSugg(text)]; | |
return suggestions; | |
} | |
} | |
CmdUtils.CreateCommand({ | |
names: ["duckduckgo", "ddg"], | |
icon: "http://www.duckduckgo.com/favicon.ico", | |
homepage: "http://gist.github.com/359342", | |
author: { name: "J. Matt Peterson", email: "rovaedne@gmail.com"}, | |
license: "MPL", | |
help: "Searches DuckDuckGo", | |
arguments: [{role:'object', nountype: noun_type_article, label:'keywords'}], | |
execute: function(args) { | |
var url = "https://duckduckgo.com/?q={QUERY}" | |
var query = args.object.text; | |
var urlString = url.replace("{QUERY}", query); | |
Utils.openUrlInBrowser(urlString); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment