(self, domain)
return None
Check if a domain is in the Umbrella Top 1 million list
Check if a domain is in the Umbrella Top 1 million list
Check if a domain is in the Umbrella Top 1 million list
def check(self, domain):
        """
        Check if a domain is in the Umbrella Top 1 million list
        """
        if not os.path.isfile(self.topfile):
            print("Umbrella Top 1 million file not available, please do harpoon update")
            return None
        with open(self.topfile) as f:
            line = f.readline().strip()
            while line != '':
                l = line.split(',')
                if domain == l[1]:
                    return int(l[0])
                line = f.readline().strip()
        return None
def check ( self , domain ) : if not os . path . isfile ( self . topfile ) : print ( "Umbrella Top 1 million file not available, please do harpoon update" ) return None with open ( self . topfile ) as f : line = f . readline ( ) . strip ( ) while line != '' : l = line . split ( ',' ) if domain == l [ 1 ] : return int ( l [ 0 ] ) line = f . readline ( ) . strip ( ) return None