Skip to content

Instantly share code, notes, and snippets.

@MattiSG
Created Aug 25, 2012
Embed
What would you like to do?
Make links from URL list
# Outputs an HTML <a> list from a list of URLs, fetching destination page titles on the go
# param = input file, in which URLs are stored, one per line
for url in $(cat $1)
do
echo '<a href="'$url'">'
curl "$url" 2> /dev/null | grep '<title>' -A 1 | tail -1 | tr -s ' '
echo '</a>'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment