Skip to content

Instantly share code, notes, and snippets.

/* Translating a webpage to english using google translate. */
CmdUtils.CreateCommand({
names: ["GTranslate"],
icon: "http://www.google.com/images/icons/illustrations/translate_search-lb80.png",
arguments: [{role: "object", nountype: noun_arb_text, label: "URL to translate"}],
description: "Translating a webpage to english using google translate.",
help: "<i>Select the url and press enter</i>.",
author: {name: "DexterGk", email: "dextergk@gmail.com"},
license: "GPL",
homepage: "http://dextergk.blogspot.com/",
@dextergk
dextergk / jmp
Created September 25, 2010 21:30
CmdUtils.CreateCommand({
names: ["jmp", "j.mp"],
home: "http://dextergk.blogspot.com/",
author: {name: "Dexter", email: "dextergk@gmail.com"},
description: "Shortens the selected URL using j.mp, <TO-DO>copying the new URL to the clipboard.",
icon: "http://j.mp/s/v124/graphics/favicon.png",
arguments: [{role: "object", nountype: noun_arb_text, label: "URL to shorten"}],
preview: function(pblock, args) {
var message = "Shortens a URL using j.mp.";
function defineWord(word, callback) {
var url = "http://services.aonaware.com/DictService/DictService.asmx/DefineInDict";
var params = Utils.paramsToString({
dictId: "wn", //wn: WordNet, gcide: Collaborative Dictionary
word: word
});
Utils.ajaxGet(url + params, function(xml) {
var text = jQuery(xml).find("WordDefinition > Definitions > Definition:first-child > WordDefinition").text();
callback(text);
/* Getting the train list from a given station pair any where in India. */
CmdUtils.CreateCommand({
names: ["TrainsList"],
icon: "http://www.erail.in/ico/erail.ico",
description: "Gets the train list for a given station pair any where in India, also displays weekly schedule.",
help: "<i>Type the command foll by source and destination station codes</i><br/>for example TrainList dli cstm.",
author: {name: "DexterGk", email: "dextergk@gmail.com"},
license: "GPL",
homepage: "http://dextergk.blogspot.com/",
arguments: [{role: 'source', nountype: noun_arb_text, label: 'city'},
@dextergk
dextergk / x.js
Created October 10, 2009 15:11
India: Train Running Status
/* This is my first ubiq command. */
CmdUtils.CreateCommand({
names: ["TrainRunStat"],
icon: "http://www.erail.in/ico/erail.ico",
description: "Finds Train Running Status for Today.",
help: "<i>Type the command foll by train number</i><br/>for example TrainRunStat 2341.",
author: {name: "DexterGk", email: "dextergk@gmail.com"},
license: "GPL",
homepage: "http://dextergk.blogspot.com/",
arguments: [{role: 'object', nountype: noun_arb_text, label: 'train code'}],