Created
September 12, 2021 07:48
-
-
Save Mr-Destructive/e1933ce1e274b5ff76dccb199eddaf2a to your computer and use it in GitHub Desktop.
This file contains 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
#!/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