2 setopt ERR_EXIT EXTENDED_GLOB
5 fpath=($cmds/functions.zsh $fpath)
8 [[ -n $dst ]] || { dst=warcs ; dst=$dst:a }
10 autoload url-to-filename
11 zmodload -F zsh/datetime b:strftime
13 --user-agent="$FEEDER_USER_AGENT"
22 [[ -n $line ]] || break
24 [[ $cols[1] = "X-URL:" ]] || continue
28 # Lazy temporary file creation
30 trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT
31 wget_opts=(--output-document=$tmp $wget_opts)
33 fn=$(strftime %Y%m%d-%H%M%S)-$(url-to-filename $url)
34 ${=WGET} $wget_opts --output-file=warcs.log --warc-file=$dst/$fn $url
35 $FEEDER_WARC_COMPRESS $dst/$fn.warc