Skip to content

Instantly share code, notes, and snippets.

@darashi
Created August 28, 2008 08:15
Show Gist options
  • Save darashi/7675 to your computer and use it in GitHub Desktop.
Save darashi/7675 to your computer and use it in GitHub Desktop.
makeSearchCommand({
name: "buzztter",
url: "http://buzztter.com/ja/k/{QUERY}",
icon: "http://buzztter.com/favicon.ico",
description: "Searches <a href=\"http://buzztter.com/ja/\">buzztter (in Japanese)</a> for your words.",
preview: function(pblock, directObject){
var searchTerm = directObject.text;
var pTemplate = "Searches <a href=\"http://buzztter.com/ja/\">buzztter (in Japanese)</a> for <b>${query}</b>.";
var pData = {query: searchTerm};
pblock.innerHTML = CmdUtils.renderTemplate(pTemplate, pData);
var url = "http://buzztter.com/top/search_partial";
var params = {q: searchTerm, language: "ja"};
jQuery.get( url, params, function(data) {
pblock.innerHTML = data;
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment