From 4c1379bffbd5b79f05cab02f1a6df7f4fd1d6006 Mon Sep 17 00:00:00 2001 From: vvinodh Date: Mon, 23 Sep 2019 16:09:32 -0500 Subject: [PATCH 1/4] Add files via upload --- main.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index bc096fb..ab042db 100644 --- a/main.py +++ b/main.py @@ -16,13 +16,22 @@ def get_fact(): return facts[0].getText() +def get_pig_latin(url): + response = requests.get(url) + split_text = response.text.split('\n') + return_text = split_text[8].strip() + return return_text @app.route('/') def home(): - return "FILL ME!" + phrase = get_fact().strip() + punctuation = phrase[-1:] + data = {'input_text': phrase[:-1],} + response = requests.post(url="https://hidden-journey-62459.herokuapp.com/piglatinize/", data=data) + pig_response = get_pig_latin(response.url) + return pig_response + punctuation if __name__ == "__main__": port = int(os.environ.get("PORT", 6787)) - app.run(host='0.0.0.0', port=port) - + app.run(host='0.0.0.0', port=port) \ No newline at end of file From 6517b01646d34de2b14698c87e6112ae51f60e83 Mon Sep 17 00:00:00 2001 From: vvinodh Date: Mon, 23 Sep 2019 16:21:13 -0500 Subject: [PATCH 2/4] Add files via upload --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index ab042db..723f5c3 100644 --- a/main.py +++ b/main.py @@ -27,7 +27,7 @@ def home(): phrase = get_fact().strip() punctuation = phrase[-1:] data = {'input_text': phrase[:-1],} - response = requests.post(url="https://hidden-journey-62459.herokuapp.com/piglatinize/", data=data) + response = requests.post(url="https://fierce-mountain-23253.herokuapp.com/", data=data) pig_response = get_pig_latin(response.url) return pig_response + punctuation From 96188c01b7619e88427ec23e519cf77f6d9e287b Mon Sep 17 00:00:00 2001 From: vvinodh Date: Mon, 23 Sep 2019 16:50:43 -0500 Subject: [PATCH 3/4] Add files via upload From dfa10f0471491bab26050e183dbb335bf52f5fee Mon Sep 17 00:00:00 2001 From: vvinodh Date: Mon, 23 Sep 2019 23:00:42 -0500 Subject: [PATCH 4/4] Add files via upload --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 723f5c3..ab042db 100644 --- a/main.py +++ b/main.py @@ -27,7 +27,7 @@ def home(): phrase = get_fact().strip() punctuation = phrase[-1:] data = {'input_text': phrase[:-1],} - response = requests.post(url="https://fierce-mountain-23253.herokuapp.com/", data=data) + response = requests.post(url="https://hidden-journey-62459.herokuapp.com/piglatinize/", data=data) pig_response = get_pig_latin(response.url) return pig_response + punctuation