• Stars
    star
    2,306
  • Rank 19,971 (Top 0.4 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open a web search in your terminal.

License ReportCard Build Release Chat

s

Web search from the terminal. Just opens in your browser.

Usage:
  s <query> [flags]

Flags:
  -b, --binary string       binary to launch search URI
  -c, --cert string         path to cert.pem for TLS
      --completion string   completion script for bash, zsh, fish or powershell
  -h, --help                help for s
  -k, --key string          path to key.pem for TLS
  -l, --list-providers      list supported providers
      --list-tags           list available tags
  -o, --output              output only mode
      --port int            server port (default 8080)
  -p, --provider string     search provider (default "presearch")
  -s, --server              launch web server
  -t, --tag string          search tag
  -v, --verbose             verbose mode
      --version             display version

Install

go get -v github.com/zquestz/s
cd $GOPATH/src/github.com/zquestz/s
make
make install

Alternatively, you can use Homebrew:

brew install s-search

Examples

Search for puppies on presearch.

s puppies

Search for dragonflies on google.

s -p google dragonflies

Search for a wifi router on amazon

s -p amazon wifi router

Search for rhinos on wikipedia

s -p wikipedia rhinos

Search providers tagged "video" for muppets.

s -t video muppets

Provider/Tag Expansion

We can do partial matching of provider and tag names. This searches Facebook for hamsters.

s -p fa hamsters

Or toasters on amazon.

s -p am toasters

This searches "tech-news" tagged providers for ssd info.

s -t te ssd

Or shopping sites for blankets.

s -t sh blankets

Provider/Tag Autocompletion

Autocompletion is supported for providers and tags. To set up autocompletion:

Bash Linux

s --completion bash > /etc/bash_completion.d/s

Bash MacOS

s --completion bash > /usr/local/etc/bash_completion.d/s

Zsh

Generate a _s completion script and put it somewhere in your $fpath:

s --completion zsh > /usr/local/share/zsh/site-functions/_s

Fish

s --completion fish > ~/.config/fish/completions/s.fish

Powershell

(& s --completion powershell) | Out-String | Invoke-Expression

Advanced

Setup an alias in your .profile for your favorite providers.

alias sa="s -p amazon"
alias sw="s -p wikipedia"

Use w3m to find cats instead of just your default browser.

s -b w3m cats

Search for conspiracy theories in incognito mode.

s -b "chromium --incognito" conspiracy theories
s -b "firefox --private-window" conspiracy theories

Search in a specific subreddit.

s -p reddit /r/cscareerquestions best startups.

Server Mode

A web interface is also provided. Just pass the -s flag.

Start a server on port 8080 (default).

s -s

Start a server with TLS on port 8443.

s -s -c /path/to/cert.pem -k /path/to/key.pem --port 8443

Feel free to try it out at https://jumps.io/.

Configuration

To setup your own default configuration just create ~/.config/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)
  • output (output only mode)
  • port (server port)
  • provider (search provider)
  • tag (search tag)
  • verbose (verbose mode)
  • whitelist (array of providers to include)

Set your default provider to duckduckgo:

provider: duckduckgo

To only search a few providers:

whitelist: [google, amazon, wikipedia]

To exclude providers you don't need:

blacklist: [dumpert]

To add a custom provider:

customProviders [
  {
    name: example
    url: "http://example.com?q=%s"
    tags: [example]
  }
]

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
  • aliexpress
  • allocine
  • amazon
  • archpkg
  • archwiki
  • ardmediathek
  • arstechnica
  • arxiv
  • atmospherejs
  • aur
  • baidu
  • bandcamp
  • bgr
  • bigbasket
  • bing
  • brave
  • buzzfeed
  • cnn
  • codepen
  • coursera
  • cplusplus
  • cppreference
  • crates
  • crunchyroll
  • debianpkg
  • dict
  • digg
  • diigo
  • dockerhub
  • dribbble
  • duckduckgo
  • dumpert
  • ecosia
  • engadget
  • explainshell
  • facebook
  • flickr
  • flipkart
  • foursquare
  • freebsdman
  • freshports
  • gibiru
  • giphy
  • gist
  • github
  • gmail
  • go
  • godoc
  • goodreads
  • google
  • googledocs
  • googleplus
  • hackernews
  • idealo
  • ietf
  • ifttt
  • imdb
  • imgur
  • inbox
  • instagram
  • kaufda
  • kickasstorrents
  • libgen
  • linkedin
  • lmgtfy
  • macports
  • magnetdl
  • mdn
  • medium
  • metacpan
  • msdn
  • naver
  • netflix
  • nhaccuatui
  • npm
  • npmsearch
  • npr
  • nvd
  • openbsdman
  • overstock
  • packagist
  • presearch
  • phandroid
  • php
  • pinterest
  • postgresql
  • python
  • quora
  • qwant
  • reddit
  • regex
  • rottentomatoes
  • rubygems
  • shodan
  • soundcloud
  • spotify
  • stackoverflow
  • steam
  • taobao
  • thepiratebay
  • theregister
  • torrentz
  • twitchtv
  • twitter
  • ultimateguitar
  • unity3d
  • upcloud
  • vimeo
  • wikipedia
  • wolframalpha
  • yahoo
  • yandex
  • youtube
  • zdf
  • zhihu

Contributors

License

s is released under the MIT license.

More Repositories

1

omniauth-google-oauth2

Oauth2 strategy for Google
Ruby
1,446
star
2

bitcoincash

Bitcoin Cash - Peer-to-Peer Electronic Cash
CSS
145
star
3

simplechat

Simple chat client written in meteor
JavaScript
76
star
4

docker-bitcoin

Bitcoin Cash full node images for Docker.
Dockerfile
74
star
5

throttled

Bandwidth limiter and QoS solution.
C++
59
star
6

em-shorty

Another URL shortener based on Event Machine and rack-fiber_pool
Ruby
58
star
7

ws-tcp-proxy

Simple websocket tcp proxy.
Go
29
star
8

smartmask

smartBCH wallet that interacts with MetaMask
Vue
18
star
9

fp-sin

Simple Sinatra shell with all the goodies.
Ruby
12
star
10

pickynode

Some people are picky about the bitcoin nodes they connect to.
Ruby
8
star
11

authpoint

Starting point for rails 3.1 apps using omniauth
Ruby
6
star
12

gemsync

Sync gems across multiple ruby installations.
Ruby
5
star
13

startpoint

Starting point for rails projects. Based on the 2.3.x series.
ActionScript
4
star
14

starcraft2

Tiny sc2 api wrapper.
Ruby
4
star
15

ports

Collection of custom macports
4
star
16

pickynode-bchd

Some people are picky about the bitcoin cash nodes they connect to with bchd.
Ruby
4
star
17

kube-ipfs

Kuberntes configurations for IPFS
Shell
3
star
18

thoughts

https://thoughts.greyh.at
CSS
3
star
19

modttl

OS X/BSD app to modify the TTL of outgoing packets.
2
star
20

handcash-go

HandCash API implementation for Go
2
star
21

kube-smartbch

Kubernetes configurations for smartBCH.
2
star
22

luckytigers.cash

Site for Lucky Tigers
Solidity
1
star
23

reapersnft

Rails Reapers Backend
Ruby
1
star
24

moodies.cash

Minting site for moodies.cash
Solidity
1
star
25

utopia-bot-docker

Dockerfile
1
star
26

greyh.at

HTML
1
star
27

backclose

A simple chrome extension. When you try to go back with no history it closes the tab.
JavaScript
1
star
28

pixelatedink

pixelatedink.io
HTML
1
star
29

kube-imageproxy

Kubernetes configurations for imageproxy.
1
star
30

helm-configs

1
star
31

summons.reapers.cash

First Reapers Summons
Solidity
1
star
32

jumps-io

1
star
33

reapers.cash

https://reapers.cash
Solidity
1
star
34

zquestz.github.com

Github pages.
1
star
35

kube-flipstarter

Kubernetes configurations for flipstarter.cash
1
star
36

PandoraMan

Small Cocoa wrapper for the Pandora service.
Objective-C
1
star