Example #1
0
def get_schedule(city, days):
    """
    returns a list of schedules indexed by days-from-now. today=0, tomorrow=1, etc
    """
    if city != "malmo":
        return [[] for day in range(days)]
    schedules = get_nutid_schedule(days, "http://217.115.59.98", "Panora")
    for schedule in schedules:
        for s in schedule:
            if sv in s["title"]:
                s["info"] = "TXT"
                s["title"] = s["title"].replace(sv, "")
    return schedules
Example #2
0
def get_schedule(city, days):
    """
    returns a list of schedules indexed by days-from-now. today=0, tomorrow=1, etc
    """
    if city != "malmo":
        return [[] for day in range(days)]
    schedules = get_nutid_schedule(days, "https://bokabiospegeln.com", "Spegeln")
    patt = re.compile("^((SALONG BAR DECO|NT|KONSERT|TEATER|CINEMATEKET): )", re.IGNORECASE)
    for schedule in schedules:
        for s in schedule:
            match = patt.match(s["title"])
            if match:
                s["title"] = s["title"][match.end(1):]
    return schedules