<commit_before>#! /usr/bin/python3
#
# http_extractor.py
#
# Extracts 
# takes a text copy of HTTP URIs from your file and extracts and prints a
# list of ip addresses and domains.
#
# Usage: http_extractor.py <user supplied filename>
#
# Writen for python3
################################################################################

# laod needed modules
import sys
import re

#check for command line arguments, asks user for filename if missing. 
if len(sys.argv) > 1:
	myFileName = (sys.argv[1])
else: 
	myFileName = input("What file has the data?: ")

dom_check = []
dom_url = re.compile(r'https?:\/\/[^\/]+:?')

# Open the user provided file as read-only, build a list from the file, and
# close.
with open(myFileName, "r") as lookup_list:
    items = lookup_list.read().splitlines()

# Get list of ip address and domains, and remove duplicates
for list_item in items:
    if dom_url.search(list_item):
        dom_match = dom_url.search(list_item)<commit_msg>Regex update<commit_after>#! /usr/bin/python3
#
# http_extractor.py
#
# Extracts 
# takes a text copy of HTTP URIs from your file and extracts and prints a
# list of ip addresses and domains.
#
# Usage: http_extractor.py <user supplied filename>
#
# Writen for python3
################################################################################

# laod needed modules
import sys
import re

#check for command line arguments, asks user for filename if missing. 
if len(sys.argv) > 1:
	myFileName = (sys.argv[1])
else: 
	myFileName = input("What file has the data?: ")

dom_check = []
dom_url = re.compile(r'(https?|meows?|hxxps?):\/\/[^\/]+:?')

# Open the user provided file as read-only, build a list from the file, and
# close.
with open(myFileName, "r") as lookup_list:
    items = lookup_list.read().splitlines()

# Get list of ip address and domains, and remove duplicates
for list_item in items:
    if dom_url.search(list_item):
        dom_match = dom_url.search(list_item)
{'fraction_non_alphanumeric': 0.18702095043433828, 'fraction_numerical': 0.004087889626980072, 'mean_word_length': 4.5, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1754707', 'n_tokens_mistral': 622, 'n_tokens_neox': 598, 'n_words': 212}