#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/web-get get-dir () { local url=$1 wget -r –level=0 -E –ignore-length -x -k -p -erobots=off -np -N $url } mails () { local f=${1:-mails.txt} local re="\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b" egrep \ -i \ -h \ -o \ --color=never \ $re \ **/*.htm(|l) | tr '[:upper:]' '[:lower:]' | sort -u \ > $f wc -l $f } dlwp () { local url=$1 local url_split=(${(s:/:)${url/://}}) local dom=$url_split[2] local accept='*.htm,*.html' local reject='*.avi,*.css,*.flv,*.gif,*.ico,*.iso,*.jpeg,*.jpg,*.js,*.mp3,*.mpeg,*.png,*.tgz' wget \ --accept=$accept \ --domains $dom \ --header="Accept: text/html" \ --html-extension \ --ignore-tags=img,link,script \ --no-clobber \ --quiet \ --recursive \ --reject=$reject \ --show-progress \ $url } dlwp-all () { local url=$1 local url_split=(${(s:/:)${url/://}}) local dom=$url_split[2] wget \ --domains $dom \ --no-clobber \ --quiet \ --recursive \ --show-progress \ $url }