Skip to content

Instantly share code, notes, and snippets.

Created Aug 25, 2012
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)
echo '<a href="'$url'">'
curl "$url" 2> /dev/null | grep '<title>' -A 1 | tail -1 | tr -s ' '
echo '</a>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment