Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xuchunyang/web-search.el

Web search from Emacs and the terminal
https://github.com/xuchunyang/web-search.el

Last synced: about 1 month ago
JSON representation

Web search from Emacs and the terminal

Awesome Lists containing this project

README

        

# web-search.el [![Build Status](https://travis-ci.org/xuchunyang/web-search.el.svg?branch=master)](https://travis-ci.org/xuchunyang/web-search.el) [![MELPA](https://melpa.org/packages/web-search-badge.svg)](https://melpa.org/#/web-search) [![MELPA Stable](https://stable.melpa.org/packages/web-search-badge.svg)](https://stable.melpa.org/#/web-search)

Web search from Emacs and the terminal. Open URL in your default web browser.

From Emacs, type `M-x web-search`.

From the terminal, use `web-search`:

```
$ web-search -h
Web search from the terminal.

Usage: web-search [options]

Options:
-h, --help display help
-l, --list-providers list supported providers
--list-tags list available tags
-o, --output output only mode
-p, --provider string search provider (default "Google")
-t, --tag string search tag
-v, --verbose verbose mode
--version display version
--completion display completion code for Bash/Zsh

```

# Examples

Search for puppies on google.
```
;; From Emacs
M-x web-search RET puppies RET

# From the terminal
$ web-search puppies
```

Search for rhinos on wikipedia
```
;; From Emacs
C-u M-x web-search RET Wikipedia RET rhinos RET

# From the terminal
$ web-search -p wikipedia rhinos
```

Search providers tagged "Code" for string-length.
```
;; From Emacs
C-u C-u M-x web-search RET Code RET string-length RET

# From the terminal
$ web-search -t code string-length
```

## Customization

See the user option `web-search-providers` and `web-search-default-provider`. To
customize the command line program `web-search`, you can put your configuration
into `$HOME/.config/web-search-config.el` or `$HOME/.web-search-config.el`, it
will be loaded *after* `web-search.el` has been loaded.

For example, to change the default provider from Google to Bing:

```elisp
(setq web-search-default-provider "Bing")
```

and to search something on [Emacs China](https://emacs-china.org/):

```elisp
(push '("Emacs China" "https://emacs-china.org/search?q=%s")
web-search-providers)
```

## Bash/Zsh Completion

Put the following line to your Bash or Zsh configuration file such as `~/.bashrc`
or `~/.zshrc`.

```sh
eval "$(web-search --completion)"
```

## Supported Providers

* 500px
* Arch Package
* Arch Wiki
* Bandcamp
* Bing
* Debian Manpages
* Debian Package
* DuckDuckGo
* Gist
* GitHub
* Google
* Hacker News
* MacPorts
* Pinterest
* Reddit
* RubyGems
* Soundcloud
* Stack Overflow
* Wikipedia
* YouTube
* Zhihu

## Acknowledgment

This project is inspired by https://github.com/zquestz/s.