Source

web2itter / views / tweets / update_tweets.rss

{{import datetime
import gluon.contrib.rss2 as rss2

items = []
for tweet in tweets:
    items.append(rss2.RSSItem(
        title='%s: %s' % (tweet['author'], tweet['tweet']),
        link='http://twitter.com/%s/status/%s' % \
                (tweet['author'], tweet['tweet_id']),
        pubDate=tweet['date'],
        description=''
    ))
pass
rss = rss2.RSS2(
    title='%s on Twitter' % response.title,
    link='http://web2py.justen.eng.br/web2itter/tweets?q=%s' % response.q,
    description=u'Livestream %s by Álvaro Justen, powered by web2py.' % \
                 response.title,
    lastBuildDate=datetime.datetime.now(),
    items=items
)
=XML(rss2.dumps(rss))}}