ashhal commited on
Commit
45c97a4
Β·
verified Β·
1 Parent(s): 16d2f94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -64,19 +64,22 @@ if selected_mood:
64
  verse_ref = random.choice(verse_list)
65
  surah_num, ayah_num = verse_ref.split(":")
66
 
67
- quran_api = f"https://api.alquran.cloud/v1/ayah/{surah_num}:{ayah_num}/editions/quran-simple,en.asad"
 
68
  response = requests.get(quran_api)
69
 
70
  if response.status_code == 200:
71
  data = response.json()['data']
72
  arabic = data[0]['text']
73
  english = data[1]['text']
 
74
  surah_info = f"{data[0]['surah']['englishName']} ({data[0]['surah']['name']})"
75
 
76
  st.markdown("### πŸŒ™ Quranic Verse")
77
  st.markdown(f"**Surah:** {surah_info} β€” Ayah {ayah_num}")
78
  st.markdown(f"<div style='font-size:24px; direction: rtl'>{arabic}</div>", unsafe_allow_html=True)
79
- st.markdown(f"*{english}*")
 
80
 
81
  # Tafsir and Dua
82
  tafsir_map = {
 
64
  verse_ref = random.choice(verse_list)
65
  surah_num, ayah_num = verse_ref.split(":")
66
 
67
+ # πŸ›  Arabic, English, Urdu
68
+ quran_api = f"https://api.alquran.cloud/v1/ayah/{surah_num}:{ayah_num}/editions/quran-simple,en.asad,ur.jalandhry"
69
  response = requests.get(quran_api)
70
 
71
  if response.status_code == 200:
72
  data = response.json()['data']
73
  arabic = data[0]['text']
74
  english = data[1]['text']
75
+ urdu = data[2]['text']
76
  surah_info = f"{data[0]['surah']['englishName']} ({data[0]['surah']['name']})"
77
 
78
  st.markdown("### πŸŒ™ Quranic Verse")
79
  st.markdown(f"**Surah:** {surah_info} β€” Ayah {ayah_num}")
80
  st.markdown(f"<div style='font-size:24px; direction: rtl'>{arabic}</div>", unsafe_allow_html=True)
81
+ st.markdown(f"**πŸ“– English:** *{english}*")
82
+ st.markdown(f"**πŸ“– Urdu:** {urdu}")
83
 
84
  # Tafsir and Dua
85
  tafsir_map = {