├── README.md
├── deploy.sh
├── g.php
├── goosh.css
├── goosh
├── ajax
│ └── ajax.js
├── config
│ └── config.js
├── goosh.js
├── goosh_alt.js
├── gui
│ └── gui.js
├── lang
│ └── lang.js
├── lib
│ ├── chop.js
│ ├── cookie.js
│ ├── dump.js
│ ├── get.js
│ ├── in_array.js
│ ├── keyboard.js
│ └── namespace.js
├── mod-alt
│ ├── gmail.js
│ ├── images.js
│ ├── login.js
│ ├── logout.js
│ ├── place.js
│ ├── translate.js
│ └── video.js
├── module-exp
│ └── .gitkeep
├── module
│ ├── addengine.js
│ ├── amazon.js
│ ├── blogs.js
│ ├── calc.js
│ ├── cd.js
│ ├── clear.js
│ ├── feed.js
│ ├── go.js
│ ├── help.js
│ ├── inurl.js
│ ├── load.js
│ ├── ls.js
│ ├── lucky.js
│ ├── more.js
│ ├── news.js
│ ├── open.js
│ ├── read.js
│ ├── settings.js
│ ├── sponsors.js
│ ├── web.js
│ └── wiki.js
├── modules
│ └── modules.js
├── searchers
│ ├── .feed.js
│ └── lang.js
└── set
│ └── set.js
└── index.php
/README.md:
--------------------------------------------------------------------------------
1 | # goosh
2 | ## About
3 | goosh is an interface to google search that behhaves similar to a unix-shell.
4 | You type commands and the results are displayed on the page.
5 |
6 | goosh is powered by google custom search.
7 |
8 | ## Example
9 | Take a look at goosh.org to see goosh in action
10 |
11 | ## License
12 | goosh is open source under the Artistic License/GPL.
13 |
14 |
--------------------------------------------------------------------------------
/deploy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "deploy goosh.org";
4 | echo "wget goosh.js";
5 | #wget http://gshell.grothkopp.com/goosh.js -O goosh.js.uncompr -o /dev/null
6 | #wget http://n.goosh.org/g.php -O goosh.js.uncompr -o /dev/null
7 | php g.php >goosh.js.uncompr
8 |
9 | echo "compress goosh.js";
10 | java -jar yui/yuicompressor-2.3.5/build/yuicompressor-2.3.5.jar --type js goosh.js.uncompr -o goosh.js.compr.tmp
11 |
12 | echo "gzip"
13 |
14 | cat goosh.js.compr.tmp |sed s\#gshell.grothkopp.com\#goosh.org\#g |sed s\#ABQIAAAA0cXSEVCNSwf_x74KTtPJMRShYK5vgJfK0afUKMRqjECszDItkhTOIyZ74499O_ys5nJIQuP4sq4nZg\#ABQIAAAA0cXSEVCNSwf_x74KTtPJMRQP4Q7D8MPck7bhT7upyfJTzVDU2BRxkUdd2AvzlDDF7DNUJI_Y4eB6Ug\#g >goosh.js.compr
15 |
16 | wget 'http://n.goosh.org/?deploy=1' -O goosh.html-dl -o /dev/null
17 |
18 | scriptLine=`grep -n "var goosh=new Object();" goosh.html-dl | cut -d : -f 1`
19 |
20 | cat goosh.html-dl | head -n $(($scriptLine-1)) > goosh.html
21 | cat goosh.js.compr >> goosh.html
22 | cat goosh.html-dl | tail -n +$(($scriptLine+1)) >> goosh.html
23 |
24 | #exit
25 | echo "copy files"
26 |
27 | if [ ! -f ../goosh.org/index.html ]; then
28 | mkdir ../goosh.org
29 | else
30 | cp ../goosh.org/index.html ../goosh.org/index.html-autosave
31 | fi
32 | cp goosh.html ../goosh.org/index.html
33 | #echo "gzip"
34 |
35 |
--------------------------------------------------------------------------------
/g.php:
--------------------------------------------------------------------------------
1 |
2 | include("goosh/goosh.js");
3 | ?>
4 |
--------------------------------------------------------------------------------
/goosh.css:
--------------------------------------------------------------------------------
1 | html { height: 100%; }
2 | body { background: #fff; font-size: 12px; font-family: monospace; height: 99%; margin:0px; padding: 0px; }
3 | form { padding: 0px; margin: 0px; }
4 | pre { font-size: 12px; }
5 | br { clear: both; }
6 | :focus { outline: 0; }
7 | input.cmdline { border: none; border: 0px; font-size: 12px; font-family: monospace; padding: 0px; margin:0px; width:100%; }
8 | table.inputtable { width:100%; vertical-align:top; }
9 | td.inputtd { width:100%; }
10 | #input { margin-left: 8px; color: #666; overflow: hidden; }
11 | #output{ margin-left: 8px; margin-top: 8px; max-width: 540px;}
12 | .less { color: #666; }
13 | .info { color: #090; }
14 | table { padding: 0px; margin: 0px; border-collapse: collapse; border-spacing: 0px; }
15 | td { padding: 0px; margin: 0px; vertical-align: top; font-size: 12px; font-family: monospace; }
16 | .help td { padding-right: 25px; font-size: 12px; }
17 | div#prompt { display: inline; white-space:nowrap; padding:0px; margin:0px; }
18 | img { border: none; }
19 | .num {width: 30px; text-align:right;}
20 | #mysite_webResult,
21 | .gsc-above-wrapper-area,
22 | .gsc-tabsAreaInvisible,
23 | .gsc-resultsHeader,
24 | .gs-watermark,
25 | .gsc-cursor-box,
26 | .gcsc-branding
27 | {display:none;}
28 |
29 | .gsc-adBlockVertical,
30 | .gsc-adBlock {
31 | float:left;
32 | margin-bottom:12px;
33 | }
34 | .gsc-resultsbox-visible {clear:both;}
35 |
--------------------------------------------------------------------------------
/goosh/ajax/ajax.js:
--------------------------------------------------------------------------------
1 | goosh.lib.namespace("goosh.ajax");
2 |
3 | goosh.ajax.contexts = new Array();
4 | goosh.ajax.lastcontext = false;
5 |
6 | goosh.ajax.stopall = function(){
7 |
8 | for(key in goosh.ajax.contexts){
9 | goosh.ajax.iscontext(key);
10 | }
11 |
12 | }
13 |
14 | goosh.ajax.deletecontext = function(context){
15 | goosh.gui.outln('Error: Operation timed out. '+context);
16 | if(!document.all) goosh.gui.outln(goosh.gui.less('If you use the noscript firefox-extension, add "ajax.googleapis.com" to the whitelist.'));
17 | goosh.gui.outln('');
18 | goosh.ajax.contexts[context]=false;
19 |
20 | var d = document.getElementById(context);
21 | if(d) document.body.removeChild(d);
22 |
23 | goosh.gui.showinput();
24 | goosh.gui.focusinput();
25 | goosh.gui.scroll();
26 | if(!document.all) stop();
27 |
28 | }
29 |
30 | goosh.ajax.iscontext = function(name){
31 |
32 | if(goosh.ajax.contexts[name]){
33 |
34 | clearTimeout(goosh.ajax.contexts[name]);
35 | goosh.ajax.contexts[name] =false;
36 |
37 | var d = document.getElementById(name);
38 | if(d) document.body.removeChild(d);
39 |
40 |
41 | return true;
42 | }
43 | else return false;
44 |
45 | }
46 |
47 | goosh.ajax.getcontext = function(name){
48 | var d = new Date();
49 | var context = d.getTime();
50 | if(name) context = name;
51 |
52 | goosh.ajax.contexts[context] = setTimeout("goosh.ajax.deletecontext('"+context+"');",1000*goosh.config.timeout);
53 |
54 | return context;
55 | }
56 |
57 | goosh.ajax.query = function(url,nohide){
58 | var context = "none";
59 | if(!nohide){
60 | context = goosh.ajax.getcontext();
61 | goosh.ajax.lastcontext = context; // more elegant with return, but doesnt work in opera
62 | goosh.gui.hideinput();
63 | }
64 |
65 |
66 | var script = document.createElement("script");
67 | document.body.appendChild(script);
68 | script.src = url+'&context='+context+'&';
69 | script.id = context;
70 |
71 | }
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/goosh/config/config.js:
--------------------------------------------------------------------------------
1 | goosh.lib.namespace("goosh.config");
2 |
3 | goosh.config.apikey = "ABQIAAAA0cXSEVCNSwf_x74KTtPJMRShYK5vgJfK0afUKMRqjECszDItkhTOIyZ74499O_ys5nJIQuP4sq4nZg";
4 |
5 | goosh.config.user = "guest";
6 | goosh.config.host = "goosh.org";
7 | goosh.config.mode = "web";
8 | goosh.config.pend = "> ";
9 |
10 | goosh.config.numres = 4;
11 | goosh.config.timeout = 4;
12 |
13 | goosh.config.start=0;
14 | goosh.config.moreobj;
15 |
16 | goosh.config.lang = "en";
17 | goosh.config.urls = new Array();
18 | goosh.config.cmdlines = new Array();
19 | goosh.config.cmdqueue = new Array();
20 |
21 | goosh.config.reflink = "on";
22 |
--------------------------------------------------------------------------------
/goosh/goosh.js:
--------------------------------------------------------------------------------
1 | var goosh = new Object();
2 | goosh.lib = new Object();
3 |
4 |
5 | include("goosh/lib/namespace.js");
6 | include("goosh/lib/in_array.js");
7 | include("goosh/lib/chop.js");
8 | include("goosh/lib/get.js");
9 | include("goosh/lib/cookie.js");
10 | include("goosh/lang/lang.js");
11 | include("goosh/gui/gui.js");
12 | include("goosh/set/set.js");
13 | include("goosh/ajax/ajax.js");
14 | include("goosh/config/config.js");
15 | include("goosh/lib/keyboard.js");
16 | include("goosh/modules/modules.js");
17 | ?>
18 |
19 |
20 |
21 | goosh.command = function(){
22 | var cmdpar = goosh.gui.inputfield.value;
23 |
24 | var tokens = cmdpar.split(" ");
25 | var args = new Array();
26 |
27 |
28 | for(i=0; i
command | aliases | parameters | function |
"; 35 | out += ""+module.name + " | ";
36 | if(module.aliases.length >1){
37 | out += "(";
38 | for(i=0;i";
49 | if( module.parameters) out += module.parameters;
50 | out += " | ";
51 | out += ""+ module.help +"\n";
52 | out += " | |
"+module.name + " | "; 31 | if(i==5){ i=0; out += ' |
name | value | default | help | "+ key + " | "; 58 | out += ""+goosh.set.list[key].get()+" | " 59 | out += ""+goosh.set.list[key].def+" | " 60 | out += ""+goosh.set.list[key].txt+" | " 61 | out += '
"+rnum+") | "; 96 | out += "";
97 | out += ''+r.title+"";
98 | out += " "; 99 | out += r.content; 100 | out += " "; 101 | out += ''+r.unescapedUrl+""; 102 | out += " "; 103 | //if(r.thumb) out += ''+r.thumb+" "; 104 | out += " |