Prayer times command line utility
The CLI accepts the following arguments:
- a string representing the city and country: e.g.
Rabat/Morocco. -sSEP, --sep SEP: the separator to be used between city and country. Default:'/'.-m, --more: prints other notable timings besides the five daily prayers.-t, --three: prints the next three days worth of prayer timings, including the current day.-J, --json: prints output as a json, to be consumed by another program.-fDATE, --fetch DATE: prints the prayer timings for the given day.-n, --next: prints the timing of the next prayer of the day.
Print the prayer timings for the current date.
$ ./bin/athan 'Rabat/Morocco'Print the prayer timings for the next three days including the current one.
$ ./bin/athan -t 'Rabat/Morocco'Print other notable timings besides the five daily prayers.
$ ./bin/athan -tm 'Rabat/Morocco'Print the output as json.
$ ./bin/athan -J 'Rabat/Morocco'It is also possible to combine options. For example, print next three days as json.
$ ./bin/athan -tJ 'Rabat/Morocco'Or print the timings for a given date as json.
$ ./bin/athan -Jf'2020-08-03' 'Rabat/Morocco'The endpoint to use is this one: http://api.aladhan.com/v1/calendarByCity
This example queries the timings for Rabat, Morocco using UOIF's method.
$ curl -s http://api.aladhan.com/v1/calendarByCity\?city\=Rabat\&country\=Morocco\&method\=12 | jqYou can also give the following parameters:
month (string)- A Gregorian calendar monthyear (string)- A Gregorian calendar yearannual (boolean)- If true, will ignore the month and return the entire yearmethod (number)- Use12
To use this program you need ruby and bundle, then run the following at the
root of the project:
$ bundle install- Disable colors if not a tty
- Use
xdgto get correct cache location - Invalidate cache if new month