Difference between revisions of "Ubiquity Commands"

From ArchWiki
Jump to: navigation, search
(New page: = Introduction = Due to my recent discovery of [http://labs.mozilla.com/2008/08/introducing-ubiquity/ Ubiquity] and MrGreen's suggestion on the [http://bbs.archlinux.org/viewtopic.php?pid...)
 
(Web Lookup)
Line 98: Line 98:
 
   }
 
   }
 
  })
 
  })
 +
 +
== Websters Dictionary ==
 +
 +
CmdUtils.CreateCommand({
 +
  name: "webster-dictionary",
 +
  author: {name: "Timothy Sorbera", email: "tim.sorbera@gmail.com"},
 +
  license: "MPL",
 +
  description: "Searches Webster's Dictionary for your words.",
 +
  takes: {search: noun_arb_text},
 +
  preview: function(pblock, searchText) {
 +
    var html = "Searches Webster's Dictionary for ";
 +
    if (searchText.text) {
 +
      html += searchText.text;
 +
    } else {
 +
      html += "your words.";
 +
    }
 +
    pblock.innerHTML = html;
 +
  },
 +
  icon: "http://www.merriam-webster.com/favicon.ico",
 +
  execute: function(directObject) {
 +
    var searchUrl = "http://www.merriam-webster.com/dictionary/" + directObject.text;
 +
    Utils.openUrlInBrowser(searchUrl);
 +
  }
 +
});
 +
 +
== Websters Thesaurus ==
 +
 +
CmdUtils.CreateCommand({
 +
  name: "webster-thesaurus",
 +
  author: {name: "Timothy Sorbera", email: "tim.sorbera@gmail.com"},
 +
  license: "MPL",
 +
  description: "Searches Webster's Thesaurus for your words.",
 +
  takes: {search: noun_arb_text},
 +
  preview: function(pblock, searchText) {
 +
    var html = "Searches Webster's Thesaurus for ";
 +
    if (searchText.text) {
 +
      html += searchText.text;
 +
    } else {
 +
      html += "your words.";
 +
    }
 +
    pblock.innerHTML = html;
 +
  },
 +
  icon: "http://www.merriam-webster.com/favicon.ico",
 +
  execute: function(directObject) {
 +
    var searchUrl = "http://www.merriam-webster.com/thesaurus/" + directObject.text;
 +
    Utils.openUrlInBrowser(searchUrl);
 +
  }
 +
});
  
 
== Whois Search ==
 
== Whois Search ==

Revision as of 05:03, 18 November 2008

Introduction

Due to my recent discovery of Ubiquity and MrGreen's suggestion on the forum, here's a place for collecting Ubiquity commands that people find of interest.

Arch Specific

AUR Search

CmdUtils.CreateCommand({
  name: "aur-packages",
  contributors: ["Mr Green", "deadrabbit"],
  license: "MPL",
  description: "Search the AUR for Packages.",
  help:  "Enter a string to search the AUR",
  takes:  {"Search string":  noun_arb_text},
  preview:  "Search the AUR for Packages.",
  icon: "http://wiki.archlinux.org/favicon.ico", 
  execute: function( search_string ) {
    var prefix_url = "http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=";
    var after_crap_url = "&SeB=nd&SB=n&SO=a&PP=25&do_Search=Go"
    var search_url = prefix_url + search_string.text + after_crap_url;
    Utils.openUrlInBrowser(search_url);
  }
})

BBS Search

CmdUtils.CreateCommand({
  name: "bbs-arch",
  contributors: ["Mr Green", "deadrabbit"],
  license: "MPL",
  description: "Search all of archlinux forums",
  help:  "Enter a string to search the archlinux forums",
  takes:  {"Search string":  noun_arb_text},
  preview:  "Search the archlinux forums.",
  icon: "http://wiki.archlinux.org/favicon.ico", 
  execute: function( search_string ) {
    var prefix_url = "http://bbs.archlinux.org/search.php?action=search&keywords=";
    var after_crap_url = "&author=&forum=-1&search_in=all&sort_by=0&sort_dir=DESC&show_as=topics&search=Submit"
    var search_url = prefix_url + search_string.text + after_crap_url;
    Utils.openUrlInBrowser(search_url);
  }
})

Bugtracker Search

CmdUtils.CreateCommand({
  name: "arch-bugs",
  contributors: ["Ghost1227", "Mr Green", "deadrabbit"],
  license: "MPL",
  description: "Search the Arch Bugtracker.",
  help: "Enter a string to search the Arch Bugtracker.",
  takes: {"Search string": noun_arb_text},
  preview: "Search the Arch Bugtracker.",
  icon: "http://bugs.archlinux.org/themes/Archer/favicon.ico",
  execute: function( search_string ) {
    var prefix_url = "http://bugs.archlinux.org/index.php?string=";
    var search_url = prefix_url + search_string.text;
    Utils.openUrlInBrowser(search_url);
  }
})

Wiki Search

CmdUtils.CreateCommand({
  name: "awiki",
  contributors: ["Mr Green", "deadrabbit"],
  license: "MPL",
  description: "Search all of archlinux wiki",
  help:  "Enter a string to search at archlinux wiki",
  takes:  {"Search string":  noun_arb_text},
  preview:  "Search all of archlinux wiki.",
  icon: "http://wiki.archlinux.org/favicon.ico",
  execute: function( search_string ) {
    var prefix_url = "http://wiki.archlinux.org/index.php/Special:Search?search=";
    var search_url = prefix_url + search_string.text;
    Utils.openUrlInBrowser(search_url);
  }
})

Web Lookup

Man Page Search

CmdUtils.CreateCommand({
  name: "man",
  contributors: ["Mr Green", "deadrabbit"],
  license: "MPL",
  description: "Search man pages",
  help:  "Enter a string to search the man pages",
  takes:  {"Search string":  noun_arb_text},
  preview:  "Search the man pages",
  execute: function( search_string ) {
    var prefix_url = "http://www.linuxmanpages.com/man1/";
    var after_crap_url = ".1.php"
    var search_url = prefix_url + search_string.text + after_crap_url;
    Utils.openUrlInBrowser(search_url);
  }
})

Websters Dictionary

CmdUtils.CreateCommand({
  name: "webster-dictionary",
  author: {name: "Timothy Sorbera", email: "tim.sorbera@gmail.com"},
  license: "MPL",
  description: "Searches Webster's Dictionary for your words.",
  takes: {search: noun_arb_text},
  preview: function(pblock, searchText) {
    var html = "Searches Webster's Dictionary for ";
    if (searchText.text) {
      html += searchText.text;
    } else {
      html += "your words.";
    }
    pblock.innerHTML = html;
  },
  icon: "http://www.merriam-webster.com/favicon.ico",
  execute: function(directObject) {
    var searchUrl = "http://www.merriam-webster.com/dictionary/" + directObject.text;
    Utils.openUrlInBrowser(searchUrl);
  }
});

Websters Thesaurus

CmdUtils.CreateCommand({
  name: "webster-thesaurus",
  author: {name: "Timothy Sorbera", email: "tim.sorbera@gmail.com"},
  license: "MPL",
  description: "Searches Webster's Thesaurus for your words.",
  takes: {search: noun_arb_text},
  preview: function(pblock, searchText) {
    var html = "Searches Webster's Thesaurus for ";
    if (searchText.text) {
      html += searchText.text;
    } else {
      html += "your words.";
    }
    pblock.innerHTML = html;
  },
  icon: "http://www.merriam-webster.com/favicon.ico",
  execute: function(directObject) {
    var searchUrl = "http://www.merriam-webster.com/thesaurus/" + directObject.text;
    Utils.openUrlInBrowser(searchUrl);
  }
});

Whois Search

CmdUtils.CreateCommand({
  name: "whois",
  contributors: ["Mr Green", "deadrabbit"],
  license: "MPL",
  description: "whois domain lookup",
  help:  "Enter a domain to query.",
  takes:  {"Search string":  noun_arb_text},
  preview:  "Enter a domain to query.",
  execute: function( search_string ) {
    var prefix_url = "http://reports.internic.net/cgi/whois?whois_nic=";
    var after_crap_url = "&type=domain"
    var search_url = prefix_url + search_string.text + after_crap_url;
    Utils.openUrlInBrowser(search_url);
  }
})