def getJSON(): url = request.args.get('url', 'http://eliotswasteland.tripod.com/twl.html') lines = request.args.get('lines', '5') words = request.args.get('words', '7') return jsonify({'poem': getPoem(url, int(lines), int(words), True)})
def shortPoem(): return template.replace("*****", getPoem("http://eliotswasteland.tripod.com/twl.html", 1, 7, True))
def defaultPoem(): return getPoem("http://eliotswasteland.tripod.com/twl.html", 5, 7, True)
def withParams(): url = request.args.get('url', 'http://eliotswasteland.tripod.com/twl.html') lines = request.args.get('lines', '5') words = request.args.get('words', '7') return getPoem(url, int(lines), int(words), True)