Skip to content

Instantly share code, notes, and snippets.

@farhaven
Created June 9, 2010 22:20
Show Gist options
  • Save farhaven/432273 to your computer and use it in GitHub Desktop.
Save farhaven/432273 to your computer and use it in GitHub Desktop.
#!/bin/env bash
datestamp=$(date +%d-%m-%y)
if [ -d $datestamp ]; then
exit -1
fi
mkdir $datestamp
for f in engines/*; do
url=$(./$f)
ftype=$(echo $url | awk -F'.' '{print $NF}')
name=$(echo $f | cut -d'.' -f1 | cut -d'/' -f2)
wget -O "$datestamp/$name.$ftype" $(./$f)
done
### und das z.b. als engine (fuer xkcd)
wget -O - xkcd.net 2> /dev/null | grep hotlink | cut -d' ' -f5 | cut -d'<' -f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment