diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..c513edf
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..66d986f
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..e7c7e7b
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/ustjay-ethay-actsfayig.iml b/.idea/ustjay-ethay-actsfayig.iml
new file mode 100644
index 0000000..8dc09e5
--- /dev/null
+++ b/.idea/ustjay-ethay-actsfayig.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Procfile b/Procfile
index 629b83a..acec4de 100644
--- a/Procfile
+++ b/Procfile
@@ -1 +1 @@
-web: python main.py
+web: python main.py runserver 0.0.0.0:6787
diff --git a/main.py b/main.py
index bc096fb..7f68b3c 100644
--- a/main.py
+++ b/main.py
@@ -1,28 +1,46 @@
-import os
+"""a simple app to serve up pig latin"""
+import os
import requests
-from flask import Flask, send_file, Response
+from flask import Flask, send_file, Response, render_template
from bs4 import BeautifulSoup
app = Flask(__name__)
+FACT_URL = 'http://unkno.com'
+PIG_LATINIZER_URL = 'https://hidden-journey-62459.herokuapp.com/piglatinize/'
def get_fact():
+ """ get the pig latin """
- response = requests.get("http://unkno.com")
-
+ response = requests.get(FACT_URL)
soup = BeautifulSoup(response.content, "html.parser")
facts = soup.find_all("div", id="content")
-
- return facts[0].getText()
+ pig_latin_prhase = facts[0].getText().strip()
+ return pig_latin_prhase
@app.route('/')
def home():
- return "FILL ME!"
+ """main functionality"""
+
+ my_fact = get_fact()
+ fact_dict = {'input_text': my_fact}
+ print(fact_dict)
+
+ pig_latin_response = requests.post(PIG_LATINIZER_URL,
+ allow_redirects=False,
+ data=fact_dict)
+ print(pig_latin_response.headers)
+ pig_latin_location = pig_latin_response.headers['Location']
+ print('test_' + pig_latin_location)
+ content = f"""
+
{my_fact}
+ Translate: {pig_latin_location}
"""
+ return render_template('pig_latin_translator.jinja2', body=content)
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) # heroku
+ #app.run(host='localhost', port=port) # local
diff --git a/requirements.bak b/requirements.bak
new file mode 100644
index 0000000..c4fd48f
--- /dev/null
+++ b/requirements.bak
@@ -0,0 +1,12 @@
+beautifulsoup4==4.6.0
+certifi==2018.4.16
+chardet==3.0.4
+click==6.7
+Flask==1.0.1
+idna==2.6
+itsdangerous==0.24
+Jinja2==2.10
+MarkupSafe==1.1.1
+requests==2.18.4
+urllib3==1.22
+Werkzeug==0.14.1
diff --git a/static/css/styles.css b/static/css/styles.css
new file mode 100644
index 0000000..75438c3
--- /dev/null
+++ b/static/css/styles.css
@@ -0,0 +1,23 @@
+body {
+ font-family: "Calibri", "Helvetica", "sans-serif";
+}
+h1 {
+ font-size: 1.313em;
+}
+
+h2 {
+ font-size: 0.9167em;
+
+p {
+ font-size: 0.9167em;
+}
+input {
+ font-size: 0.9167em;
+}
+input {
+ font-size: 0.9167em;
+}
+}
+a:link {
+ text-decoration: none;
+}
\ No newline at end of file
diff --git a/templates/base.jinja2 b/templates/base.jinja2
new file mode 100644
index 0000000..4777d14
--- /dev/null
+++ b/templates/base.jinja2
@@ -0,0 +1,14 @@
+
+
+Random Facts in Pig Latin
+
+
+
+
+ Pig Latin Translator
+ {% block content %} {% endblock content %}
+
+
+
diff --git a/templates/pig_latin_translator.jinja2 b/templates/pig_latin_translator.jinja2
new file mode 100644
index 0000000..fa2f371
--- /dev/null
+++ b/templates/pig_latin_translator.jinja2
@@ -0,0 +1,4 @@
+{% extends 'base.jinja2' %}
+{% block content %}
+{{body}}
+{% endblock content %}
\ No newline at end of file