17c50dcd2f35ad307ad7682ed9b60385784396af
   1#! /bin/bash
   2
   3# get urls from duckduckgo, then parse them to wget to download
   4
   5args=("$@")
   6search=${args[0]}
   7filetype=${args[1]}
   8
   9set -f
  10urls=`curl -silent https://duckduckgo.com/html/\?q\=site:www.mash.dept.shef.ac.uk/Resources | 
  11grep 'pdf$' | tr -d ' \t\r' | grep -v '^[0-9]' | awk '{print "http://" $0}'`
  12
  13for url in $urls; do
  14        wget --cut-dirs=100 -P /mnt/andrew/literature/mathcentre/ $url
  15done