Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
John Gafnea committed Aug 29, 2024
1 parent b7b55fd commit f7778de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
9 changes: 4 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import requests
from faker import Faker
from flask import Flask, render_template

app = Flask(__name__)
fake = Faker()


@app.route("/")
def get_index() -> str:
# Use Faker for header
first, second = [fake.bs() for _ in range(2)]
# Use Faker/Mocker API for header. Call twice and combine responses with "and".
response = requests.get("https://api.mockster.dev/api/v1/companies").json()
first, second = [response[i].get("buzzPhrase") for i in range(2)]
header = f"{first.title()} and {second.title()}"

# Use API for paragraph
# Use ITFT API for paragraph.
response = requests.get("https://itsthisforthat.com/api.php?json").json()
this, that = response.values()
paragraph = f"Basically it's {this} for {that}"
Expand Down
23 changes: 7 additions & 16 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
blinker==1.8.1
certifi==2024.2.2
blinker==1.8.2
certifi==2024.7.4
charset-normalizer==3.3.2
click==8.1.7
exceptiongroup==1.2.1
Faker==25.0.0
Flask==3.0.3
gunicorn==22.0.0
idna==3.7
iniconfig==2.0.0
idna==3.8
itsdangerous==2.2.0
Jinja2==3.1.3
Jinja2==3.1.4
MarkupSafe==2.1.5
packaging==24.0
pluggy==1.5.0
python-dateutil==2.9.0.post0
requests==2.31.0
six==1.16.0
tomli==2.0.1
urllib3==2.2.1
Werkzeug==3.0.2
requests==2.32.3
urllib3==2.2.2
Werkzeug==3.0.4

0 comments on commit f7778de

Please sign in to comment.