#!/usr/bin/perl


die "Missing parameter\n" if ($#ARGV<0);
 
$url = "'https://scholar.google.com/scholar?hl=en&q=";

$url .= shift;

for(@ARGV) {
	$url .= "+" . $_;
}
$url .= "'";
print "$url\n";

@output = qx{wget -O output -U 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36' $url};

@file = qx{cat output};
for (@file) {
	print "$1\n" if ($_ =~ m/About (\d+\,{0,1}\d*) results/);
}

qx{rm output};
