cristibodnariuc commited on
Commit
75b9b3b
·
verified ·
1 Parent(s): 0954546

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -43,7 +43,7 @@ def get_random_joke(type: str) -> str:
43
  url = "https://official-joke-api.appspot.com/types"
44
  response = requests.get(url, timeout=20)
45
  types = response.json()
46
- url = f"https://official-joke-api.appspot.com/jokes{f"/{type}" if type and type in types else ""}/random"
47
  # Send a GET request to the URL with a 20-second timeout
48
  response = requests.get(url, timeout=20)
49
  response.raise_for_status() # Raise an exception for bad status codes
 
43
  url = "https://official-joke-api.appspot.com/types"
44
  response = requests.get(url, timeout=20)
45
  types = response.json()
46
+ url = f"https://official-joke-api.appspot.com/jokes{f'/{type}' if type and type in types else ''}/random"
47
  # Send a GET request to the URL with a 20-second timeout
48
  response = requests.get(url, timeout=20)
49
  response.raise_for_status() # Raise an exception for bad status codes