def search_domain(domain):
record_list = []
print("[*] Trying target domain: {}".format(domain))
for index in index_list:
print("[*] Trying index {}".format(index))
cc_url = "http://index.commoncrawl.org/CC-MAIN-"
cc_url += index
cc_url += "-index?"
cc_url += "url="
cc_url += domain
cc_url += "&matchType=domain&output=json"
# Make request to CommonCrawl index
response = requests.get(cc_url)
if response.status_code == 200:
records = response.content.splitlines()
for record in records:
record_list.append(json.loads(record))
print("[*] Added {}results.".format(len(records)))
print("[*] Found a total of {} hits.".format(len(record_list)))
return record_list