Skip to content

Instantly share code, notes, and snippets.

@d0rb
d0rb / check_gmail.py
Created March 20, 2024 10:12
The check_gmail.py script is designed to determine the validity of a provided email address by checking if it has a public Google Calendar associated with it. The script achieves this by sending an HTTP request to the corresponding Google Calendar URL and analyzing the response. Based on the response received, the script provides insight into wh…
import sys
import requests
from bs4 import BeautifulSoup
def check_calendar_url(email):
url = f"https://calendar.google.com/calendar/ical/{email}/public/basic.ics"
try:
response = requests.get(url)
if response.status_code == 200:
print("The email address is valid!")