-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsalah
More file actions
executable file
·33 lines (31 loc) · 1.44 KB
/
salah
File metadata and controls
executable file
·33 lines (31 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
now=$(date +"%Y-%m-%d")
if [[ $1 = "-r" ]]; then
curl -X GET \
-H "Cache-Control: no-cache" \
-H "Postman-Token: bd2c3688-8c88-c4b8-5fd7-486d0f26b8c6" \
-o "$HOME/.salah.txt" \
"https://www.muwaqqit.com/api.csv?add=Kalf%2B470%2C%2B1509%2BBE%2BZaandam%2C%2BNetherlands&d=""$now""&diptype=apparent&dn=Today&ea=-18.0&eh=1.64&ehtype=observer&eo=1.64&fa=-18.0&fea=0.5&ia=4.5&isn=-10.0&isna=0.5&k=0.155&ln=4.8411387<=52.4716922&p=1010.0&rsa=0.5&t=15.0&tz=Europe%2FAmsterdam&tztype=auto&vc=5.65&z=7" \
1> /dev/null
shift
fi
case "$1" in
f*)
awk 'BEGIN { FS="," }; /^'"$now"'/ || NR == 1 { printf "%-17s%-17s%-17s%-17s%-17s%-17s%-17s\n", $1, $17, $21, $23, $25, $28, $30 }' $HOME/.salah.txt
;;
d*)
awk 'BEGIN { FS="," }; /^'"$now"'/ || NR == 1 { printf "%-17s%-17s\n", $1, $36 }' $HOME/.salah.txt
;;
a*)
awk 'BEGIN { FS="," }; /^'"$now"'/ || NR == 1 { printf "%-17s%-17s%-17s\n", $1, $39, $45 }' $HOME/.salah.txt
;;
m*)
awk 'BEGIN { FS="," }; /^'"$now"'/ || NR == 1 { printf "%-17s%-17s%-17s%-17s\n", $1, $49, $52,$54 }' $HOME/.salah.txt
;;
i*)
awk 'BEGIN { FS="," }; /^'"$now"'/ || NR == 1 { printf "%-17s%-17s%-17s%-17s\n", $1, $56, $60, $62 }' $HOME/.salah.txt
;;
*)
awk 'BEGIN { FS="," }; /^'"$now"'/ || NR == 1 { printf "%-17s%-17s%-17s%-17s%-17s%-17s%-17s%-17s%-17s%-17s%-17s%-17s%-17s%-17s%-17s%-17s\n", $1, $17, $21, $23, $25, $28, $30, $36, $39, $45, $49, $52, $54, $56, $60, $62 }' $HOME/.salah.txt
;;
esac