def get_cal(sample_html=None): events = [] text = requests.get(make_url()).text lines = text.strip().split('\n') for line in lines: e = line.split('\t') events.append(extract_event(e)) cal = rCal(name='MIT', description='Events at MIT', events=events) return cal.to_ical()
def get_cal(sample_html=None): today = datetime.date.today() events = [] for day_delta in range(rcal_config['days']): date = today + datetime.timedelta(days=day_delta) if sample_html is None: html = get_day_html(date) else: html = sample_html events.extend(extract_events(date, parse_day_html(html))) cal = rCal(name='NEC', description='Concerts at New England Conservatory', events=events) return cal.to_ical()