fixed some merge problems

This commit is contained in:
psy 2013-09-09 12:11:51 -07:00
parent 80aa7cee7d
commit 18b0177e18

10
main.py
View File

@ -40,6 +40,10 @@ class bc(object):
self.browser_version = "" self.browser_version = ""
self.url = "" self.url = ""
self.old_url = "" self.old_url = ""
self.ip = ""
self.city = ""
self.country = ""
self.routes = ""
def set_options(self, options): def set_options(self, options):
""" """
@ -223,6 +227,7 @@ class bc(object):
url = urlparse(self.getURL()).netloc #changed this for prototyping url = urlparse(self.getURL()).netloc #changed this for prototyping
url = url.replace('www.','') #--> doing a tracert to example.com and www.example.com yields different results. url = url.replace('www.','') #--> doing a tracert to example.com and www.example.com yields different results.
url_ip = socket.gethostbyname(url) url_ip = socket.gethostbyname(url)
self.ip = url_ip
print "Host:", url, "\n" print "Host:", url, "\n"
if self.options.debug == True: if self.options.debug == True:
print "Host ip:", url_ip, "\n" print "Host ip:", url_ip, "\n"
@ -275,10 +280,15 @@ class bc(object):
city = record['city'] city = record['city']
print "Trace:", count, "->", ip, "->", city, "->", country print "Trace:", count, "->", ip, "->", city, "->", country
count+=1 count+=1
self.city = city
self.country = country
self.routes = "Trace:", count, "->", ip, "->", city, "->", country
elif record.has_key('country_name'): elif record.has_key('country_name'):
country = record['country_name'] country = record['country_name']
print "Trace:", count, "->", ip, "->", country print "Trace:", count, "->", ip, "->", country
count+=1 count+=1
self.country = country
self.routes = "Trace:", count, "->", ip, "->", country
except: except:
print "Trace:", count, "->", "Not allowed" print "Trace:", count, "->", "Not allowed"
count+=1 count+=1