From 1b5a4651a9b7bf64b90547eca97bceb70c977037 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 1 Mar 2016 14:48:53 +0100 Subject: [PATCH] Trivial refactoring --- lib/core/settings.py | 2 +- thirdparty/pagerank/pagerank.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 903d909a1..80b94fd8e 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version and site -VERSION = "1.0.0.9" +VERSION = "1.0.0.10" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") diff --git a/thirdparty/pagerank/pagerank.py b/thirdparty/pagerank/pagerank.py index 4e4c99ed2..85dbe82fa 100644 --- a/thirdparty/pagerank/pagerank.py +++ b/thirdparty/pagerank/pagerank.py @@ -16,14 +16,12 @@ import sys import urllib import urllib2 -TIMEOUT = 10 - -def get_pagerank(url): +def get_pagerank(url, timeout=10): 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)) try: req = urllib2.Request(_) - rank = urllib2.urlopen(req, timeout=TIMEOUT).read().strip()[9:] + rank = urllib2.urlopen(req, timeout=timeout).read().strip()[9:] except: rank = 'N/A' else: