aboutsummaryrefslogtreecommitdiffstats
path: root/commands/revip
diff options
context:
space:
mode:
authorEUcancER <root@euer.krebsco.de>2012-04-18 11:28:20 +0200
committerEUcancER <root@euer.krebsco.de>2012-04-18 11:28:20 +0200
commit2b1eb54f10a7babd114e216f1be32cb6f313ec46 (patch)
tree4bf34c35ebafa587fa4231819b5ae5baaae5c55e /commands/revip
parente5db44476ecf70b6bd6d9d66333251093a68dd0b (diff)
fix url parser
Diffstat (limited to 'commands/revip')
-rwxr-xr-xcommands/revip5
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/revip b/commands/revip
index 1d20037..b4920f5 100755
--- a/commands/revip
+++ b/commands/revip
@@ -6,6 +6,7 @@ import os
import json
import socket
import httplib
+from urlparse import urlparse
try:
target = sys.argv[1]
except:
@@ -25,7 +26,7 @@ for a in aliases:
sites[a] = ""
offset = 0
appid = os.environ.get("BING_APPID",'7A0B8DA3E913BE5ECB4AF11C7BC398B43000DC1C')
-while offset < 50:
+while offset < 300:
url ="/json.aspx?AppId=%s&Query=ip:%s&Sources=Web+RelatedSearch+News+Image+Video&Version=2.2&Market=en-us&Web.Count=50&Web.Offset=%s&Web.Options=DisableQueryAlterations" % (appid, ip, offset)
conn = httplib.HTTPConnection("api.bing.net")
conn.request("GET", url)
@@ -35,7 +36,7 @@ while offset < 50:
results = doc["SearchResponse"]["Web"]["Results"]
conn.close()
for res in results:
- sites[res['DisplayUrl']] = ""
+ sites[urlparse(res['Url'])[1]] = ""
offset += 50
except:
break