def get(self): term = self.request.get('term') dept = self.request.get('dept') course = self.request.get('course') school_name = self.request.path.rstrip('/').split('/')[-1] school = parsers.import_parser(school_name) options = school.get_available_options(term, dept, course) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(server.getjson(options))
def get(self): retailer_name = self.request.path.rstrip('/').split('/')[-1] retailer = parsers.import_parser(retailer_name) query = self.request.get('q') type = self.request.get('type') textbooks = server.getjson(retailer.search(query, type)) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(textbooks)
def get(self): retailer_name, isbn = self.request.path.rstrip('/').split('/')[-2:] retailer = parsers.import_parser(retailer_name) listings = '' if retailer: listings = server.getjson(retailer.lookup_listings(isbn)) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(listings)
def get(self): self.response.headers['Content-Type'] = 'application/json' self.response.out.write(server.getjson(available_retailers()))
def get(self): isbn = self.request.path.rstrip('/').split('/')[-1] textbook = server.getjson(halfdotcom.lookup_isbn(isbn)) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(textbook)