Created
August 25, 2012 21:45
-
-
Save MattiSG/3471254 to your computer and use it in GitHub Desktop.
Make links from URL list
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
# 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