Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
	def initialize(self):
		self.a = ArticleProvider()