From f7778decf926ba0f56051b9bb94b7f96bc552868 Mon Sep 17 00:00:00 2001 From: John Gafnea Date: Thu, 29 Aug 2024 12:53:12 -0500 Subject: [PATCH] chore: cleanup --- app.py | 9 ++++----- requirements.txt | 23 +++++++---------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/app.py b/app.py index f1977b3..a4ac43c 100644 --- a/app.py +++ b/app.py @@ -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}" diff --git a/requirements.txt b/requirements.txt index 3557ba3..e716b4b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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