#!/bin/sh
#CCCP script by hampa@chello.se
#this script will connect to all hubs and do a search query

#only hubs with atleast minusers in
minusers=300

nick="cccp_spider"
searchquery="*lord of the rings*7"
#save the quereys here
logfile="ms.log" 

#internal
s4='$4'
s2='$2'

hublist=`hublist | awk -F\| "{if($s4>$minusers) print $s2}"`

for hub in $hublist
do
	echo connecting to $hub
	dctc -n $nick -o 99999999 -p 10001 -x -g $hub &
	sleep 5 
	cccp -H $hub -s "$searchquery" >> $logfile 
	cccp -X
done
