https://github.com/shivammg/bandict
Command-line Urban Dictionary Search
https://github.com/shivammg/bandict
Last synced: 6 days ago
JSON representation
Command-line Urban Dictionary Search
- Host: GitHub
- URL: https://github.com/shivammg/bandict
- Owner: shivamMg
- License: gpl-3.0
- Created: 2015-12-12T13:50:07.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-14T19:09:15.000Z (almost 10 years ago)
- Last Synced: 2025-01-28T03:51:15.470Z (9 months ago)
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## bandict
Command-line [Urban Dictionary](https://www.urbandictionary.com/) Search in Go
### Install
**bandict** requires Go. You can download it from [here](https://golang.org/dl/).
Run the following command:
```bash
$ go get github.com/shivammg/bandict
```Make sure you have `$GOPATH/bin` in your `$PATH`. If you don't, you can add it in your shell configuration file:
```bash
PATH="$PATH:$GOPATH/bin"
```### Change Preferences
Three constants have been defined in `main.go`. Change them to change preferences.
```go
NO_OF_RESULTS = 1
WRAP_WIDTH = 80
DISPLAY_FOOTER = true
```**NO_OF_RESULTS**: Number of definitions to be displayed by default (optionally can be specified with the `-n` flag).
**WRAP_WIDTH**: Word-wrap width for the output text.
**DISPLAY_FOOTER**: Display footer containing number of results fetched and displayed.
### Flags
`-n`: Number of results to be displayed. If not specified, **NO_OF_RESULTS** is used.
`-w`: Search string. If not specified, requested in the next line.
`-s`: Display sound files for the search string (not the definitions).
### Examples
Display three results. Search string requested in the next line.
```bash
$ bandict -n 3
```Display three results for the string "thug life".
```bash
$ bandict -w 'thug life' -n 3
```Display sound files (pronunciations) for the search string. One on each line.
```bash
$ bandict -w 'lmao' -s
```Use the command to download the first file:
```bash
$ wget $(bandict -w 'lmao' -s | sed -n 1p)
```### License
See LICENSE file.