sp
is a command line utility to search Startpage.com from the terminal.
It is inspired by the projects ddgr and googler.
$ pip install spcli
$ sp -h
usage: sp.py [-h] [-d] [-f] [-s SITE] [-t SPAN] [-u] [-v] [-np]
[--browser BROWSER] [--json] [--no-color]
[keywords [keywords ...]]
Search Startpage.com from the terminal.
positional arguments:
keywords search keywords
optional arguments:
-h, --help show this help message and exit
-d, --debug enable debug logging
-f, --first open the first result in a web browser
-s SITE, --site SITE search a site
-t SPAN, --time SPAN time limit search to 1 d|w|m|y (day,week,month,year)
-u, --unsafe disable the family filter
-v, --version show program's version number and exit
-np, --no-prompt do not enter interactive mode
--browser BROWSER open results using this web browser
--json output the results in JSON; implies --no-prompt
--no-color disable color output
Version 1.0.4
Copyright © 2018 Gary Blackwood <gary@garyblackwood.co.uk>
License: GPLv3
Website: https://github.com/garee/sp
f view the first set of results
n view the next set of results
p view the previous set of results
[index] open search result in web browser
c [index] copy the search result link to the clipboard
s KEYWORDS perform a search for KEYWORDS
? show help
q exit
* all other inputs are treated as new search keywords
$ sp hello world
bbc.co.uk
for news about brexit:$ sp -s bbc.co.uk brexit
$ sp -t d barcelona fc
$ sp -f python docs
$ sp -u pawn
$ sp --json climate change papers
If the BROWSER
environment variable exists, it will be used to open search results. If not, sp
will attempt to use one from the this list.
You can specify which browser to use using the --browser
flag. This also accepts a path to the browser executable.
$ sp --browser firefox
The requests library is used to perform the HTTP requests. You can configure proxies by setting the environment variables HTTP_PROXY
and HTTPS_PROXY
.
$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.2.10.1080"
Create and activate a virtual environment.
$ mkvirtualenv -p python3 sp
$ workon sp
Install the dependencies.
$ pip install -r requirements.txt
Format the code.
$ black sp/*.py
Run static analysis on the code.
$ pylint sp/*.py
$ flake8 sp/*.py
Please create an issue for any problems that you encounter.
$ sp --no-color