dotfiles/home/default/scripts/wget-titles-from-urls

9 lines
235 B
Bash
Executable File

#!/bin/bash
# Appends the title of a URL in the format of
# "# Title\nURL\n\n"
while read -r URL; do
TITLE=`curl -L "$URL" | grep -o "<title>.*</title>" | sed -E "s/<title>(.*)<\/title>/\1/"`
printf "# $TITLE\n$URL\n\n"
done