Looks like the google url has changed.
Replace line #66 with
gurl = 'http://toolbarqueries.google.com/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s' % (hsh,urllib.quote(URL))
works for me
Also, I am confused with what do you expect from this script. PageRank ranks website not search queries. If you want to see how high your website is on different google queries that's a different story and has little to do with PageRank. This script will tell you what's the pagerank of particular website, whatever the search query which will not tell you the relative position of your website for this particular query. These are different things.