My Scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
473 B

# Prints the word of the day from merriam webster along with its definition.
html=$(curl -s --connect-timeout 0.1
wod=$(echo "$html" | grep -Eo "<h1>\w+</h1>" | sed -E 's|<h1>(\w+)</h1>|\1|g') # Parse word of the day.
def=$(echo "$html" | grep -Eo '<strong>:</strong>.+</p>' | sed -E 's|<strong>:</strong> (.+)</p>|\1|g') # Parse definition
if [ -n "$wod" ] && [ -n "$def" ]
echo -e "\n$wod ~ $def\n"