#!/bin/sh
#CCCP script that watches a query and downloads all matches

#OBS!!!
#you probably want to change the awk regexp
#will match rows where file 2 (filename) has mp3, pdf or zip extension

#the actual script is in dlrobot.pl 

searchquery="*ebook*1"

cccp -r "DONE"

until 1
do
cccp -N -s "$searchquery" | awk -F\| '{if(match($2,/pdf$|zip$/))print $0}' | perl dlrobot.pl
sleep 600 
done
