Jay Taylor's notes
back to listing indexzquestz/s
[web search]autocomplete | Add tag support to everything | 3 months ago | |
cmd | Bump version to 0.5.2 | 2 months ago | |
launcher | Comment exported methods and structs | 5 months ago | |
providers | Added crates to search for rust libs | a month ago | |
server | Refactor provider tag lookup | 2 months ago | |
.gitignore | Binary release via Travis-CI | 4 months ago | |
.travis.yml | Missed one 1.6.1 reference | 2 months ago | |
CONTRIBUTING.md | NIT: Files should have ending newline | 5 months ago | |
LICENSE | Initial commit | 5 months ago | |
Makefile | Tweak make install to not run go build | 2 months ago | |
README.md | Added crates to search for rust libs | a month ago | |
s.go | Added crates to search for rust libs | a month ago | |
signals.go | Added support for google, amazon, wikipedia, duckduckgo, bing and yahoo | 5 months ago |
README.md
s
Web search from the terminal. Just opens in your browser.
normalUsage:
s <query> [flags]
Flags:
-b, --binary string binary to launch search URI
-c, --cert string path to cert.pem for TLS
-k, --key string path to key.pem for TLS
-l, --list-providers list supported providers
--list-tags list available tags
--port int server port (default 8080)
-p, --provider string search provider (default "google")
-s, --server launch web server
-t, --tag string search tag
-v, --verbose verbose mode
--version display version
normal
Install
normalgo get -v github.com/zquestz/s
cd $GOPATH/src/github.com/zquestz/s
make
make install
normal
Alternatively, you can use Homebrew:
normalbrew install s-search
normal
Examples
Search for puppies on google.
normals puppies
normal
Search for a wifi router on amazon
normals -p amazon wifi router
normal
Search for rhinos on wikipedia
normals -p wikipedia rhinos
normal
Search providers tagged "video" for muppets.
normals -t video muppets
normal
Provider/Tag Expansion
We can do partial matching of provider and tag names. This searches Facebook for hamsters.
normals -p fa hamsters
normal
Or toasters on amazon.
normals -p am toasters
normal
This searches "tech-news" tagged providers for ssd info.
normals -t te ssd
normal
Or shopping sites for blankets.
normals -t sh blankets
normal
Provider/Tag Autocompletion
Autocompletion is supported for providers and tags. To set up autocompletion:
- Have
s
installed - Add the following lines to
~/.bash_profile
or~/.zshrc
normalif [ -f $GOPATH/src/github.com/zquestz/s/autocomplete/s-completion.bash ]; then
. $GOPATH/src/github.com/zquestz/s/autocomplete/s-completion.bash
fi
normal
Now you are good to go.
normals -p ba<TAB><TAB>
baidu bandcamp
normal
Fish
Alternatively, if you use fish, the following will work:
normalmkdir -p ~/.config/fish/completions
ln -s $GOPATH/src/github.com/zquestz/s/autocomplete/s.fish ~/.config/fish/completions/s.fish
normal
Advanced
Setup an alias in your .profile
for your favorite providers.
normalalias sa="s -p amazon"
alias sw="s -p wikipedia"
normal
Use w3m to find cats instead of just your default browser.
normals -b w3m cats
normal
Search for conspiracy theories in incognito mode.
normals -b "chromium --incognito" conspiracy theories
s -b "firefox --private-window" conspiracy theories
normal
Search in a specific subreddit.
normals -p reddit /r/cscareerquestions best startups.
normal
Server Mode
A web interface is also provided. Just pass the -s
flag.
Start a server on port 8080 (default).
normals -s
normal
Start a server with TLS on port 8443.
normals -s -c /path/to/cert.pem -k /path/to/key.pem --port 8443
normal
Feel free to try it out at https://jumps.io/.
Configuration
To setup your own default configuration just create ~/.s/config
. The configuration file is in UCL format. JSON is also fully supported as UCL can parse JSON files.
For more information about UCL visit: https://github.com/vstakhov/libucl
The following keys are supported:
- blacklist (array of providers to exclude)
- binary (binary to launch search URI)
- cert (path to cert.pem for TLS)
- customProviders (array of custom providers)
- key (path to key.pem for TLS)
- port (server port)
- provider (search provider)
- tag (search tag)
- verbose (verbose mode)
- whitelist (array of providers to include)
Set your default provider to duckduckgo:
normalprovider: duckduckgo
normal
To only search a few providers:
normalwhitelist: [google, amazon, wikipedia]
normal
To exclude providers you don't need:
normalblacklist: [dumpert]
normal
To add a custom provider:
normalcustomProviders [
{
name: example
url: "http://example.com?q=%s"
tags: [example]
}
]
normal
Custom providers require a few things:
- An alphanumeric name.
^[a-zA-Z0-9_]*$
- A
%s
token for the query string. - A valid URL scheme.
Supported Providers
- 500px
- 8tracks
- amazon
- archpkg
- archwiki
- arstechnica
- arxiv
- atmospherejs
- aur
- baidu
- bandcamp
- bgr
- bing
- buzzfeed
- cnn
- codepen
- coursera
- cplusplus
- crates
- crunchyroll
- debianpkg
- digg
- diigo
- dockerhub
- dribbble
- duckduckgo
- dumpert
- engadget
- flickr
- flipkart
- foursquare
- gist
- github
- gmail
- go
- godoc
- googledocs
- googleplus
- hackernews
- ietf
- ifttt
- imdb
- imgur
- inbox
- kickasstorrents
- libgen
- lmgtfy
- macports
- mdn
- medium
- metacpan
- msdn
- naver
- netflix
- nhaccuatui
- npm
- npmsearch
- npr
- nvd
- overstock
- packagist
- phandroid
- php
- postgresql
- python
- quora
- rottentomatoes
- rubygems
- shodan
- soundcloud
- spotify
- stackoverflow
- steam
- taobao
- thepiratebay
- theregister
- torrentz
- twitchtv
- unity3d
- upcloud
- vimeo
- wikipedia
- wolframalpha
- yahoo
- yandex
- youtube
Contributors
- Josh Ellithorpe (zquestz)
- Christian Petersen (fnky)
- Preet Bhinder (mbhinder)
- Robert-Jan Keizer (KeizerDev)
- Vitor Cortez (vekat)
- David Liu (tw4dl)
- Lex Broner (akb)
- Diego Jara (djap96)
- Luvsandondov Lkhamsuren (lkhamsurenl)
- Eray Aydın (erayaydin)
- Murilo Santana (mvrilo)
License
s is released under the MIT license.