def get_data() -> None:
    '\n    Infinite loop of every 10min requests to Vilnius vaccination center.\n    Collects count of vaccines and adds to PostgreSQL database.\n    Sends an email if Pfizer vaccine is available.\n    '
    while True:
        sql_connection = psycopg2.connect(database=DATABASE, user=USER, password=PASSWORD, host=HOST)
        cur = sql_connection.cursor()
        headers = {'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'sec-ch-ua': '^\\^', 'sec-ch-ua-mobile': '?0', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Sec-Fetch-Site': 'cross-site', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-User': '?1', 'Sec-Fetch-Dest': 'document', 'Accept-Language': 'en-US,en;q=0.9'}
        page = requests.get('https://vilnius-vac.myhybridlab.com/selfregister/vaccine', headers=headers)
        soup = BeautifulSoup(page.content, 'html.parser')
        vaccines = soup.find('vaccine-rooms', class_=None)[':vaccine-rooms']
        json_object = json.loads(vaccines)
        time_raw = soup.find('small', class_='text-muted').get_text().split()
        time_str = ((time_raw[2] + ' ') + time_raw[3])
        dt = datetime.fromisoformat(time_str)
        now = datetime.now().replace(microsecond=0)
        eet_dt = (now + timedelta(hours=3))
        diff_secs = (eet_dt - dt).seconds
        total_sleep = (602 - diff_secs)
        moderna = json_object[0]['free_total']
        pfizer = json_object[1]['free_total']
        astra = json_object[2]['free_total']
        janssen = json_object[3]['free_total']
        cur.execute(f"INSERT INTO vilnius_vakcinos (time, moderna, pfizer, astra_zeneca, janssen) VALUES ('{time_str}', {moderna}, {pfizer}, {astra}, {janssen});")
        sql_connection.commit()
        sql_connection.close()
        if (pfizer > 0):
            send_email('Pfizer count: {pfizer}, link to register: https://vilnius-vac.myhybridlab.com/selfregister/vaccine')
        time.sleep(total_sleep)
Infinite loop of every 10min requests to Vilnius vaccination center.
Collects count of vaccines and adds to PostgreSQL database.
Sends an email if Pfizer vaccine is available.
def get_data() -> None:
    '\n    Infinite loop of every 10min requests to Vilnius vaccination center.\n    Collects count of vaccines and adds to PostgreSQL database.\n    Sends an email if Pfizer vaccine is available.\n    '
    while True:
        sql_connection = psycopg2.connect(database=DATABASE, user=USER, password=PASSWORD, host=HOST)
        cur = sql_connection.cursor()
        headers = {'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'sec-ch-ua': '^\\^', 'sec-ch-ua-mobile': '?0', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Sec-Fetch-Site': 'cross-site', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-User': '?1', 'Sec-Fetch-Dest': 'document', 'Accept-Language': 'en-US,en;q=0.9'}
        page = requests.get('https://vilnius-vac.myhybridlab.com/selfregister/vaccine', headers=headers)
        soup = BeautifulSoup(page.content, 'html.parser')
        vaccines = soup.find('vaccine-rooms', class_=None)[':vaccine-rooms']
        json_object = json.loads(vaccines)
        time_raw = soup.find('small', class_='text-muted').get_text().split()
        time_str = ((time_raw[2] + ' ') + time_raw[3])
        dt = datetime.fromisoformat(time_str)
        now = datetime.now().replace(microsecond=0)
        eet_dt = (now + timedelta(hours=3))
        diff_secs = (eet_dt - dt).seconds
        total_sleep = (602 - diff_secs)
        moderna = json_object[0]['free_total']
        pfizer = json_object[1]['free_total']
        astra = json_object[2]['free_total']
        janssen = json_object[3]['free_total']
        cur.execute(f"INSERT INTO vilnius_vakcinos (time, moderna, pfizer, astra_zeneca, janssen) VALUES ('{time_str}', {moderna}, {pfizer}, {astra}, {janssen});")
        sql_connection.commit()
        sql_connection.close()
        if (pfizer > 0):
            send_email('Pfizer count: {pfizer}, link to register: https://vilnius-vac.myhybridlab.com/selfregister/vaccine')
        time.sleep(total_sleep)