ii-sa commited on
Commit
b9cfca6
·
verified ·
1 Parent(s): 42aceb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -45,7 +45,9 @@ def get_page_in_quran(page: int) -> str:
45
  response = requests.get(api_url)
46
  if response.status_code == 200:
47
  data = response.json()
48
- return data.get("data", f"No data available for page: {page} in the quran")
 
 
49
  else:
50
  return f"Error: Unable to fetch page: {page} in the quran"
51
  except Exception as e:
 
45
  response = requests.get(api_url)
46
  if response.status_code == 200:
47
  data = response.json()
48
+ ayahs = data['ayahs']
49
+ page_content = "\n".join([ayah['text'] for ayah in ayahs])
50
+ return page_content
51
  else:
52
  return f"Error: Unable to fetch page: {page} in the quran"
53
  except Exception as e: