1 from google
.appengine
.ext
import webapp
2 from google
.appengine
.ext
.webapp
.util
import run_wsgi_app
5 import simplejson
as json
7 class MainPage(webapp
.RequestHandler
):
9 self
.response
.headers
['Content-Type'] = 'text/plain'
10 self
.response
.out
.write('Hello, webapp World!')
12 class Parse(webapp
.RequestHandler
):
14 self
.response
.headers
['Content-Type'] = 'text/plain'
15 urls
= self
.request
.get_all('url')
16 inline_logo
= self
.is_set('inline_logo')
19 podcasts
= [feeddownloader
.parse_feed(url
, inline_logo
) for url
in urls
]
20 pretty
= json
.dumps(podcasts
, sort_keys
=True, indent
=4)
21 self
.response
.out
.write(pretty
)
23 self
.response
.set_status(400)
24 self
.response
.out
.write('parameter url missing')
26 def is_set(self
, param
, default
='0'):
28 return int(self
.request
.get(param
, default
))
32 application
= webapp
.WSGIApplication([
39 run_wsgi_app(application
)
41 if __name__
== "__main__":