mirror of https://github.com/torappinfo/uweb
address bar: :! to add example command line file web.js & web.sh
parent
aeec3960f5
commit
cd87cc793c
@ -0,0 +1,15 @@
|
|||||||
|
let ess = {};
|
||||||
|
ess["g"]=["https://google.com/search?q=",];
|
||||||
|
ess["v"]=["https://www.youtube.com/results?search_query=",];
|
||||||
|
ess["b"]=["http://www.bing.com/search?q=",];
|
||||||
|
ess["w"]=["https://encyclopedia.thefreedictionary.com/",];
|
||||||
|
|
||||||
|
let url=arguments[1];
|
||||||
|
let iS1 = url.search(/ [^ ]/);
|
||||||
|
let iS2 = url.indexOf(' ',iS1+2);
|
||||||
|
let name = url.substring(iS1+1,iS2)
|
||||||
|
let keywords = url.substring(iS2+1);
|
||||||
|
let es = ess[name];
|
||||||
|
if(es){
|
||||||
|
location.href=es[0]+keywords;
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/dash
|
||||||
|
#usage: g [engine] word1 word2 ...
|
||||||
|
|
||||||
|
default=''
|
||||||
|
g="https://www.google.com.hk/search?q="
|
||||||
|
yt="https://www.youtube.com/results?search_query="
|
||||||
|
m="http://www.merriam-webster.com/dictionary/"
|
||||||
|
w="http://en.wikipedia.org/wiki/"
|
||||||
|
wd="https://en.wiktionary.org/wiki/"
|
||||||
|
b="http://www.bing.com/search?intlF=1&q="
|
||||||
|
ks="http://www.iciba.com/"
|
||||||
|
en="http://www.enacademic.com/searchall.php?SWord="
|
||||||
|
gen="http://gen.lib.rus.ec/search.php?req="
|
||||||
|
abb="http://audiobookbay.li/?s="
|
||||||
|
|
||||||
|
bd="https://www.baidu.com/s?wd="
|
||||||
|
gb="https://www.gigablast.com/search?q="
|
||||||
|
yd="http://dict.youdao.com/search?q="
|
||||||
|
a="http://www.amazon.com/s?url=search-alias%3Daps&field-keywords="
|
||||||
|
bdic="http://cn.bing.com/dict/search?q="
|
||||||
|
be="http://www.britannica.com/search?query="
|
||||||
|
u="http://www.urbandictionary.com/define.php?term="
|
||||||
|
o="http://en.oxforddictionaries.com/definition/"
|
||||||
|
|
||||||
|
eval engine=\$${1:-default} #engine=$(eval echo \${$1})
|
||||||
|
|
||||||
|
shift #concate second argument to the last one with +
|
||||||
|
string=$1
|
||||||
|
shift
|
||||||
|
for a in "$@"
|
||||||
|
do
|
||||||
|
string+="+$a"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo $engine$string
|
Loading…
Reference in New Issue