from datetime import datetime
from typing import Iterable
import requests
import re


def cors_get_station_lists_for_day(date: datetime) -> Iterable[str]:
    """
    Given a date, returns the stations that the US CORS network
    reports as available
    """
    url = "https://geodesy.noaa.gov/corsdata/rinex/"
    resp = requests.get(url + date.strftime("%Y/%j/"))

    pat = '<a href="..../">([a-z0-9]{4})/</a>'
    return re.findall(pat, resp.text)