示例#1
0
文件: mit.py 项目: rscohn2/rococal
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()
示例#2
0
文件: mit.py 项目: rscohn2/rococal
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()
示例#3
0
文件: nec.py 项目: rscohn2/rococal
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()