Skip to content

Instantly share code, notes, and snippets.



Last active Jul 23, 2020
What would you like to do?
#!/usr/bin/env python3
# Google Groups v1
# python3 domains.txt
import requests
import re
import sys
with open(sys.argv[1]) as f:
sites =
msg = ""
for site in sites:
r = requests.get(""+site+"/d/")
if r.status_code == 500:
msg = "500 Error: Google Groups not found"
elif "Redirecting to" in r.text:
rr = requests.get(""+site+"/d/&hl=en&service=groups2&hd="+site)
if rr.status_code == 200 and "" in rr.url:
msg = "- redirect to Google"
msg = "- redirect to {}".format(rr.url)
except requests.exceptions.RequestException as e:
host = re.findall(r"host='(.*?)', port", str(e))[0]
uri = re.findall(r'url: (.*?) \(Caused', str(e))[0]
msg = "- redirect to INTERNAL HOST: {}{}".format(host, uri)
elif r.status_code == 404:
msg = "- 404"
msg = "- Open!"
print(site, msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.