开发者

any rss feed lib for gae

i want enable rss for gae on my site .

and did you know the simple way to do this ?

thanks

this is a example i searched:

class FeedHandler(BaseRequestHandler):
    def get(self,tags=None):
        blogs = Weblog.all().filter('entrytype =','post').order('-date').fetch(10)
        last_updated = datetime.datetime.now()
        if blogs and blogs[0]:
            last_updated = blogs[0].date
            last_updated = last_updated.strftime("%Y-%m-%dT%H:%M:%SZ")
        for blog in blogs:
            blog.formatted_date = blog.date.strftim开发者_运维知识库e("%Y-%m-%dT%H:%M:%SZ")
        self.response.headers['Content-Type'] = 'application/atom+xml'
        self.generate('atom.xml',{'blogs':blogs,'last_updated':last_updated})

any more simple ?


Have a look to PyRSS2Gen.
You could find many examples of self-made python blogs on Google appengine that generate RSS 2.0 feed using PyRSS2Gen.
Here and Here some good examples.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜