Skip to content

feat(prayer-times): add support to Mawaqit#3

Open
yoyossef wants to merge 4 commits into0xzer0x:mainfrom
yoyossef:main
Open

feat(prayer-times): add support to Mawaqit#3
yoyossef wants to merge 4 commits into0xzer0x:mainfrom
yoyossef:main

Conversation

@yoyossef
Copy link
Copy Markdown

@yoyossef yoyossef commented Nov 2, 2024

Adds a new method that allows for scraping the prayer times from the
Mawaqit (https://mawaqit.net/) service, which powers numerous Mosques
around the world to communicate its prayer times.

By selecting the 99th method you can specify during the install the ID
of your Mosque to get the prayer times.

Also adds a small patch to fix the install script which didn't work correctly
for me.

An error I would see with the install.sh script would be that the
selected options from the script were not reflected in the script
installed, after investigation it seems like the sed commands targeted
single quotes, so by setting single-quotes everywhere it fixed it.
@0xzer0x
Copy link
Copy Markdown
Owner

0xzer0x commented Nov 2, 2024

Hijri calendar of the current year also need to be fetched and added to the final JSON before saving to prayers.json file; since the response from Mawaqit contains the prayer times calendar for the whole year, no point in fetching the calendar without checking if the year is different.

Adds a new method that allows for scraping the prayer times from the
Mawaqit (https://mawaqit.net) service, which powers numerous Mosques
around the world to communicate its prayer times.

By selecting the 99th method you can specify during the install the ID
of your Mosque to get the prayer times.
Mawaqit sends yearly calendars for the prayer times, so if the JSON is
already present, there is no need to fetch it another time if the year
in the JSON is still current.
@yoyossef
Copy link
Copy Markdown
Author

yoyossef commented Nov 2, 2024

Assalamu alaykum @0xzer0x this is a good suggestion, however Mawaqit is sending the prayer times calendar in gregorian format only

I still added the yearly check though, you were right no need to fetch if the year hasn't changed

@0xzer0x
Copy link
Copy Markdown
Owner

0xzer0x commented Nov 2, 2024

Walaikum Assalam,

We will need to send an additional request to Al Adhan API to get the hijri calendar for the current month and save it locally in order to be able to display it. This will also require adjusting the hijri function to use the correct file with the correct jq query.

@yoyossef
Copy link
Copy Markdown
Author

yoyossef commented Nov 4, 2024

@0xzer0x Should be ready for review now 👍

Fetches the Aladhan API to make the current month's hijri calendar
available in the JSON, making the new API support more feature complete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants