#!/bin/awk -f BEGIN { while (getline<"countries") c[$0]=0 for (i in c) { system("sleep "rand()*8+1) while ("curl -A 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)' \ 'http://www.google.com/search?q=\"fifa+world+cup\"+prognosis+\""i"\"'" \ |getline) if (match($0,/id=resultStats>About .* results median for (i in r) for (j in r) if (r[i]>r[j]) { s=int(2*(r[i]-r[j])) if (s>3) s-- # psychological: 3 goals are enough if (s>5) s-- # idem t=int(2/(r[i]-r[j])) print i"-"j": "s"-"(s>t?t:(s>0?s-1:0)) } }