class RssHandler(tornado.web.RequestHandler): def initialize(self): self.a = ArticleProvider() def get(self): self.set_header("Content-Type", "application/rss+xml") self.a.atom_dates() self.render("templates/index.xml", title="unsure.org blog feed", url="http://unsure.org", author="Matthew Finlayson", email="*****@*****.**", items=self.a.parsed_list)
class ArticleHandler(tornado.web.RequestHandler): def initialize(self): self.a = ArticleProvider() def get(self, new_url): article = self.a.fetch_one(new_url) if not article: raise tornado.web.HTTPError(404) self.render("templates/article.html", title=article["title"], item=article)
def initialize(self): self.a = ArticleProvider()