Skip to content

Commit 09b8bc3

Browse files
emircanerkuldehesa
authored andcommitted
Update and rename prayer-times-diyanet.sh to prayer-times.sh
Replace source of the API with more stable and comprehensive one.
1 parent 71e08d9 commit 09b8bc3

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

commands/culture/prayer-times-diyanet.sh renamed to commands/culture/prayer-times.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# Required parameters:
99
# @raycast.schemaVersion 1
10-
# @raycast.title Prayer Times (Diyanet)
10+
# @raycast.title Prayer Times
1111
# @raycast.mode inline
1212
# @raycast.packageName Culture
1313

@@ -17,16 +17,16 @@
1717
# Documentation
1818
# @raycast.author Emircan Erkul
1919
# @raycast.authorURL https://emircanerkul.com
20-
# @raycast.description Prayer Times grabbed from the Diyanet's Official Website for people located in Türkiye.
20+
# @raycast.description Prayer Times grabbed from the aladhan.com.
2121

22-
data=$(curl -s https://namazvakitleri.diyanet.gov.tr/tr-TR/9654/kocaeli-icin-namaz-vakti)
23-
24-
imsak=$(echo "$data" | pcregrep -o1 '_imsakTime = "(.*)"')
25-
gunes=$(echo "$data" | pcregrep -o1 '_gunesTime = "(.*)"')
26-
ogle=$(echo "$data" | pcregrep -o1 '_ogleTime = "(.*)"')
27-
ikindi=$(echo "$data" | pcregrep -o1 '_ikindiTime = "(.*)"')
28-
aksam=$(echo "$data" | pcregrep -o1 '_aksamTime = "(.*)"')
29-
yatsi=$(echo "$data" | pcregrep -o1 '_yatsiTime = "(.*)"')
22+
data=$(curl -s -L 'http://api.aladhan.com/v1/timingsByCity?city=derince&country=turkey&method=13')
23+
24+
imsak=$(echo "$data" | jq --raw-output '.data.timings.Imsak')
25+
gunes=$(echo $data | jq --raw-output '.data.timings.Sunrise')
26+
ogle=$(echo "$data" | jq --raw-output '.data.timings.Dhuhr')
27+
ikindi=$(echo "$data" | jq --raw-output '.data.timings.Asr')
28+
aksam=$(echo "$data" | jq --raw-output '.data.timings.Maghrib')
29+
yatsi=$(echo "$data" | jq --raw-output '.data.timings.Isha')
3030

3131
NOW=$(gdate +%s)
3232

@@ -59,5 +59,4 @@ fi
5959

6060
output="$REMANINING $imsak ⚙︎ $gunes ⚙︎ $ogle ⚙︎ $ikindi ⚙︎ $aksam ⚙︎ $yatsi"
6161

62-
echo $output | tr -d '\n' | LANG=tr_TR.UTF-8 pbcopy
6362
echo $output

0 commit comments

Comments
 (0)