#!/bin/bash # # Httrack feed downloader. # # Load and initialize source `dirname $0`/lib/httracker/functions || exit 1 # Parameters DIRNAME="`dirname $0`" BASENAME="`basename $0`" FILE="$1" # Grab item list if [ -z "$FILE" ]; then # Get URLs from feed # Thanks http://stackoverflow.com/questions/443991/how-to-parse-rss-feeds-xml-in-a-shell-script curl -s "$FEED" | grep -o '[^<]*' | grep -o "[^>]*$" > $URLS if [ "$?" != "0" ]; then echo "Error downloading feed $FEED, aborting." exit 1 fi elif [ -e "$FILE" ]; then # Get URLs from file cat $FILE > $URLS else echo "usage: $BASENAME [file]" fi # Iterate over all URLs httracker_iterate # Done httracker_teardown