def get(self): try: # target = json.loads(self.request.body)["target"] target = self.request.GET['target'] isCourse = 'course' in self.request.GET # if target is a number its an ID! try: target = long(target) except ValueError: pass # This is required so that fetch requests doesn't time out! urlfetch.set_default_fetch_deadline(60) g = Grabber(target, isCourse) self.response.headers[ 'Content-Type'] = 'application/rss+xml; charset=utf-8' self.response.write(g.grab_rss_feed()) except ValueError: self.response.status = '400 malformed request body' except KeyError: self.response.status = '400 no target url specified' except InvalidTarget: self.response.status = '400 Could not find ID'