Minor fix

This commit is contained in:
Miroslav Stampar 2014-09-14 22:57:41 +02:00
parent 637d3cbaf7
commit ffa7e2f6e9

View File

@ -15,6 +15,7 @@
import urllib import urllib
def get_pagerank(url): def get_pagerank(url):
url = url.encode('utf8') if isinstance(url, unicode) else url
_ = 'http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank&ch=%s&q=info:%s' % (check_hash(hash_url(url)), urllib.quote(url)) _ = 'http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank&ch=%s&q=info:%s' % (check_hash(hash_url(url)), urllib.quote(url))
try: try:
f = urllib.urlopen(_) f = urllib.urlopen(_)