Skip to content

Instantly share code, notes, and snippets.

@nemesis64
Created September 15, 2018 00:07
Show Gist options
  • Select an option

  • Save nemesis64/4f7f286980737e48a290c5dc3ca20eef to your computer and use it in GitHub Desktop.

Select an option

Save nemesis64/4f7f286980737e48a290c5dc3ca20eef to your computer and use it in GitHub Desktop.
bash Script for urban dictionary definition
curl -s "https://api.urbandictionary.com/v0/tooltip?term=$1" | python3 -c "import sys, json, html; print(html.unescape(json.load(sys.stdin)['string']).split('\n',2)[1])"
@KebabLord
Copy link

KebabLord commented Nov 9, 2020

also bash function

urbandict(){
    curl -s "https://api.urbandictionary.com/v0/tooltip?term=${1}" |
    python3 -c "import sys, json, html; print(html.unescape(json.load(sys.stdin)['string']).split('\n',2)[1])"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment