Skip to content

Instantly share code, notes, and snippets.

@Mr-Destructive
Created September 12, 2021 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mr-Destructive/e1933ce1e274b5ff76dccb199eddaf2a to your computer and use it in GitHub Desktop.
Save Mr-Destructive/e1933ce1e274b5ff76dccb199eddaf2a to your computer and use it in GitHub Desktop.
#!/bin/bash
read -p "Enter the word to find meaning : " word
output="meaning.txt"
url="https://www.dictionary.com/browse/$word"
curl -o $output $url
clear
grep -oP '(?<=<span class="one-click-content css-nnyc96 e1q3nk1v1">).*?(?=</span>)' $output >temp.txt
sed -i 's/<[^>]*>//g' temp.txt >$output
grep -v '^\s*$\|^\s*\#' temp.txt >$output
echo "$word"
while read meaning
do
echo $meaning
done < $output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment