Skip to content

Instantly share code, notes, and snippets.

@dextergk dextergk/x.js
Created Oct 11, 2009

What would you like to do?
/* Getting the train list from a given station pair any where in India. */
names: ["TrainsList"],
icon: "",
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: ""},
license: "GPL",
homepage: "",
arguments: [{role: 'source', nountype: noun_arb_text, label: 'city'},
{role: 'goal', nountype: noun_arb_text, label: 'city'}],
preview: function preview(pblock, {source, goal}) {
pblock.innerHTML =;
execute: function({source, goal}) {
if(source.text) {
var temp = source.text;
var l = temp.indexOf(" ");
var src = temp.substr(0,l); var des = temp.substr(l+1,temp.length); }
var baseUrl = ""+src.toUpperCase()+"::"+des.toUpperCase()+":";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.