Ejemplo n.º 1
0
def ical_to_json(event, tags, prefix):
    return common.event_as_json(
        ext_id=event.get("uid").encode("utf-8"),
        title=prefix + event.get("summary").encode("utf-8"),
        url=event.get("url").encode("utf-8"),
        date_time_begin=event.get("dtstart").dt,
        date_time_end=event.get("dtend").dt,
        tags=tags)
Ejemplo n.º 2
0
def build_event(match):
    d = config.copy()
    d.update(match.groupdict())
    dt = common.dict_to_date_time(d)
    return common.event_as_json(
        ext_id='%s@%s' % (dt.strftime('%Y%m%d'),d['url']),
        title=d['title'],
        url=d['url'],
        date_time_begin=dt,
        tags=d['tags']
    )
Ejemplo n.º 3
0
import feedparser
import common
import arrow
import sys

f = open(sys.argv[1], "w")
d = feedparser.parse("http://www.munichdot.net/events/feed")
for entry in d.entries:
    dtbegin = arrow.get(entry.updated).datetime
    event = common.event_as_json(
        ext_id=entry.id, title=".NET User Group: " + entry.title, url=entry.link, date_time_begin=dtbegin, tags=[".net"]
    )
    f.write(event)
f.close()