-
-
Save extratone/b8f07e8727ef76ab4d0a76716014bbac to your computer and use it in GitHub Desktop.
A shell function that looks up a word via the Wordnik API, grabs each definition via json, and cats out the results with line numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Define a word in the terminal via the Wordnik API with numbered output | |
| function def() { | |
| params="$@" | |
| params_encoded=${params/ /%20} | |
| curl --silent http://api.wordnik.com:80/v4/word.json/"$params_encoded"/definitions\?api_key\="$WORDNIK_KEY" \ | |
| | json --array text \ | |
| | cat -b | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment