diff --git a/app.py b/app.py old mode 100644 new mode 100755 index a5409a8..df4620b --- a/app.py +++ b/app.py @@ -10,15 +10,18 @@ from bs4 import BeautifulSoup try: max_len = int(sys.argv[1]) except IndexError: - max_len = 255 + max_len = None def cleanlist(my_list): - retList = [] - for x in my_list: - if len(x) == (max_len + 3): - retList.append(x) - return retList + if max_len != None: + retList = [] + for x in my_list: + if len(x) == (max_len + 3): + retList.append(x) + return retList + else: + return my_list def fetch(): @@ -36,10 +39,14 @@ def parse(): final_list = [s.replace("xn--", "") for s in final_list] # remove all the 8s the_list = cleanlist(final_list) final_list = the_list.sort() # sorts normally by alphabetical order - the_list = sorted(the_list, key=len, reverse=False) + out = cmd.Cmd() if len(the_list) > 0: - out = cmd.Cmd() - out.columnize(the_list, displaywidth=80) + if max_len != None: + the_list = sorted(the_list, key=len, reverse=False) + out.columnize(the_list, displaywidth=80) + else: + the_list = sorted(the_list, reverse=False) + out.columnize(the_list, displaywidth=140) else: print("No expired domains with the length citeria you wanted!")