Beispiel #1
0
def ical():
        
    # init calendar
    cal = Calendar()
    cal.add('prodid', '-//Radio freies Krautchan//EN')
    cal.add('version', '2.0')
    cal.add('method', 'PUBLISH' )
      
    # add some useful iCal extensions
    cal.add('x-wr-calname', 'RfK')
    cal.add('x-wr-caldesc', 'Radio freies Krautchan')
    cal.add('x-wr-timezone', 'UTC')
    
    # adding planned shows
    result = get_shows()
    
    if result:
        for show in result:
            
            djs = get_djs(show)
            summary = "%s with %s" % (show.name, ', '.join(djs))
            
            event = Event()
            event.add('uid', str(show.show))
            event.add('summary', summary)
            event.add('description', show.description)
            event.add('dtstart', show.begin)
            event.add('dtend', show.end)
            cal.add_component(event)
            
    return Response(cal.to_ical(), mimetype='text/calendar')
Beispiel #2
0
def ical():
    # init calendar
    cal = Calendar()
    cal.add('prodid', '-//Radio freies Krautchan//EN')
    cal.add('version', '2.0')
    cal.add('method', 'PUBLISH')

    # add some useful iCal extensions
    cal.add('x-wr-calname', 'RfK')
    cal.add('x-wr-caldesc', 'Radio freies Krautchan')
    cal.add('x-wr-timezone', 'UTC')

    # adding planned shows
    result = get_shows()

    if result:
        for show in result:
            djs = get_djs(show)
            summary = "%s with %s" % (show.name, ', '.join(djs))

            event = Event()
            event.add('uid', str(show.show))
            event.add('summary', summary)
            event.add('description', show.description)
            event.add('dtstart', show.begin)
            event.add('dtend', show.end)
            cal.add_component(event)

    return Response(cal.to_ical(), mimetype='text/calendar')
Beispiel #3
0
def atom():
    # init feed
    feed = AtomFeed('Radio freies Krautchen', subtitle='Upcomming shows', url='http://radio.krautchan.net')

    # adding planned shows
    result = get_shows()

    if result:
        for show in result:
            djs = get_djs(show)
            author = ', '.join(djs)

            feed.add(id=str(show.show),
                     title=show.name,
                     content=show.description,
                     author=author,
                     url=url_for('show.show_view', show=show.show),
                     updated=show.begin,
                     published=show.begin)
    return feed.get_response()
Beispiel #4
0
def atom():
    # init feed
    feed = AtomFeed('Radio freies Krautchen', subtitle='Upcomming shows', url='http://radio.krautchan.net')

    # adding planned shows
    result = get_shows()

    if result:
        for show in result:
            djs = get_djs(show)
            author = ', '.join(djs)

            feed.add(id=str(show.show),
                     title=show.name,
                     content=show.description,
                     author=author,
                     url=url_for('show.show_view', show=show.show),
                     updated=show.begin,
                     published=show.begin)

    return feed.get_response()