diff --git a/adhan.pyw b/adhan.pyw new file mode 100644 index 0000000..e2427e3 --- /dev/null +++ b/adhan.pyw @@ -0,0 +1,152 @@ +from bs4 import BeautifulSoup +import requests +from datetime import datetime, time + + +website = 'https://www.halaltrip.com/prayertimes/muslim-salat-prayer-times/?name=Slough&f=Slough%2C+UK&l=Slough&s=&c=United+Kingdom&lat=51.4989355&lng=-0.5612772&no_days=7&cal_method=3&asr_method=2&higher_lat=2&cruising_height=11800' #Change the URL to the placve you live +result = requests.get(website) +content = result.text + + +soup = BeautifulSoup(content, 'lxml') + + +prayerTime = soup.find('ul', class_='tm-horizontal-listitem clearfix highlighted').get_text() + + +print(prayerTime) + + +lines = prayerTime.split('\n')[1:-1] + + +lines = prayerTime.split('\n')[1:-1] + +lines = prayerTime.split('\n')[1:-1] + + +del lines[0] +del lines[1] + + +lines = [line.replace(':00', ':0') for line in lines] + + +fajrHour, fajrMin = map(int, lines[0].split(':')) +zuhrHour, zuhrMin = map(int, lines[1].replace('00', '0').split(':')) +asrHour, asrMin = map(int, lines[2].split(':')) +maghribHour, maghribMin = map(int, lines[3].split(':')) +ishaHour, ishaMin = map(int, lines[4].split(':')) + + +lines = [line.lstrip('0') if line[0] == '0' else line for line in lines] + + +lines = [line[:-2] + line[-1] if line[-2] == '0' else line for line in lines] + + +fajrHour, fajrMin = map(int, lines[0].split(':')) +zuhrHour, zuhrMin = map(int, lines[1].split(':')) +asrHour, asrMin = map(int, lines[2].split(':')) +maghribHour, maghribMin = map(int, lines[3].split(':')) +ishaHour, ishaMin = map(int, lines[4].split(':')) + +current_time = datetime.now().time() + + +fajr_time = time(fajrHour, fajrMin) +zuhr_time = time(zuhrHour, zuhrMin) +asr_time = time(asrHour, asrMin) +maghrib_time = time(maghribHour, maghribMin) +isha_time = time(ishaHour, ishaMin) + + +if current_time < fajr_time: + next_prayer = "Fajr" + next_prayer_hour = fajrHour + next_prayer_min = fajrMin +elif current_time < zuhr_time: + next_prayer = "Zuhr" + next_prayer_hour = zuhrHour + next_prayer_min = zuhrMin +elif current_time < asr_time: + next_prayer = "Asr" + next_prayer_hour = asrHour + next_prayer_min = asrMin +elif current_time < maghrib_time: + next_prayer = "Maghrib" + next_prayer_hour = maghribHour + next_prayer_min = maghribMin +elif current_time < isha_time: + next_prayer = "Isha" + next_prayer_hour = ishaHour + next_prayer_min = ishaMin +else: + next_prayer = "Fajr" + next_prayer_hour = fajrHour + next_prayer_min = fajrMin + + +print(next_prayer, next_prayer_hour, next_prayer_min) + + +with open('name.txt', 'w') as file: + file.write(f'{next_prayer}\n') + +with open('hours.txt', 'w') as file: + file.write(f'{next_prayer_hour}\n') + +with open('minutes.txt', 'w') as file: + file.write(f'{next_prayer_min}\n') + + +print(f"Fajr: {fajrHour}:{fajrMin}") +print(f"Zuhr: {zuhrHour}:{zuhrMin}") +print(f"Asr: {asrHour}:{asrMin}") +print(f"Maghrib: {maghribHour}:{maghribMin}") +print(f"Isha: {ishaHour}:{ishaMin}") + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# prayerTime = soup.find('span', class_='text-light prayer-margin-left').get_text() + +# prayerTimeFormatted = prayerTime.replace(" ", "").replace("\n", "") +# prayerTimeFormatted = prayerTimeFormatted[:-3] +# hours, minutes = prayerTimeFormatted.split(':') + + + + +# filePrayerName = open("name.txt", "w") +# filePrayerName.write(prayerName) + +# filePrayerTime = open("hours.txt", "w") +# filePrayerTime.write(hours) + +# filePrayerTime = open("minutes.txt", "w") +# filePrayerTime.write(minutes) \ No newline at end of file diff --git a/fonts/Product Sans Bold Italic.ttf b/fonts/Product Sans Bold Italic.ttf new file mode 100644 index 0000000..129d12d Binary files /dev/null and b/fonts/Product Sans Bold Italic.ttf differ diff --git a/fonts/Product Sans Bold.ttf b/fonts/Product Sans Bold.ttf new file mode 100644 index 0000000..d847195 Binary files /dev/null and b/fonts/Product Sans Bold.ttf differ diff --git a/fonts/Product Sans Italic.ttf b/fonts/Product Sans Italic.ttf new file mode 100644 index 0000000..5fc56d4 Binary files /dev/null and b/fonts/Product Sans Italic.ttf differ diff --git a/fonts/Product Sans Regular.ttf b/fonts/Product Sans Regular.ttf new file mode 100644 index 0000000..c0442ee Binary files /dev/null and b/fonts/Product Sans Regular.ttf differ diff --git a/fonts/productsans.ttf b/fonts/productsans.ttf new file mode 100644 index 0000000..5e046b5 Binary files /dev/null and b/fonts/productsans.ttf differ diff --git a/image/abudhabi.png b/image/abudhabi.png new file mode 100644 index 0000000..f6d8a6e Binary files /dev/null and b/image/abudhabi.png differ diff --git a/image/abudhabiflag.png b/image/abudhabiflag.png new file mode 100644 index 0000000..3e62bb4 Binary files /dev/null and b/image/abudhabiflag.png differ diff --git a/image/australia.png b/image/australia.png new file mode 100644 index 0000000..18c1eca Binary files /dev/null and b/image/australia.png differ diff --git a/image/australiaflag.png b/image/australiaflag.png new file mode 100644 index 0000000..b17dfe5 Binary files /dev/null and b/image/australiaflag.png differ diff --git a/image/austria.png b/image/austria.png new file mode 100644 index 0000000..bd3721d Binary files /dev/null and b/image/austria.png differ diff --git a/image/austriaflag.png b/image/austriaflag.png new file mode 100644 index 0000000..f35e2c8 Binary files /dev/null and b/image/austriaflag.png differ diff --git a/image/azerbaijan.png b/image/azerbaijan.png new file mode 100644 index 0000000..fd83f12 Binary files /dev/null and b/image/azerbaijan.png differ diff --git a/image/azerbaijanflag.png b/image/azerbaijanflag.png new file mode 100644 index 0000000..8bfa65f Binary files /dev/null and b/image/azerbaijanflag.png differ diff --git a/image/bahrain.png b/image/bahrain.png new file mode 100644 index 0000000..5e31ff6 Binary files /dev/null and b/image/bahrain.png differ diff --git a/image/bahrainflag.png b/image/bahrainflag.png new file mode 100644 index 0000000..18ab545 Binary files /dev/null and b/image/bahrainflag.png differ diff --git a/image/belgium.png b/image/belgium.png new file mode 100644 index 0000000..d63efbd Binary files /dev/null and b/image/belgium.png differ diff --git a/image/belgiumflag.png b/image/belgiumflag.png new file mode 100644 index 0000000..48c996b Binary files /dev/null and b/image/belgiumflag.png differ diff --git a/image/brazil.png b/image/brazil.png new file mode 100644 index 0000000..c267b1b Binary files /dev/null and b/image/brazil.png differ diff --git a/image/brazilflag.png b/image/brazilflag.png new file mode 100644 index 0000000..a93fbc2 Binary files /dev/null and b/image/brazilflag.png differ diff --git a/image/britain.png b/image/britain.png new file mode 100644 index 0000000..e57c178 Binary files /dev/null and b/image/britain.png differ diff --git a/image/britainflag.png b/image/britainflag.png new file mode 100644 index 0000000..80fb303 Binary files /dev/null and b/image/britainflag.png differ diff --git a/image/canada.png b/image/canada.png new file mode 100644 index 0000000..dfd78e5 Binary files /dev/null and b/image/canada.png differ diff --git a/image/canadaflag.png b/image/canadaflag.png new file mode 100644 index 0000000..4ef0fff Binary files /dev/null and b/image/canadaflag.png differ diff --git a/image/cota.png b/image/cota.png new file mode 100644 index 0000000..d83073f Binary files /dev/null and b/image/cota.png differ diff --git a/image/hungary.png b/image/hungary.png new file mode 100644 index 0000000..4ea709a Binary files /dev/null and b/image/hungary.png differ diff --git a/image/hungaryflag.png b/image/hungaryflag.png new file mode 100644 index 0000000..522ac3c Binary files /dev/null and b/image/hungaryflag.png differ diff --git a/image/imola.png b/image/imola.png new file mode 100644 index 0000000..1590582 Binary files /dev/null and b/image/imola.png differ diff --git a/image/italyflag.png b/image/italyflag.png new file mode 100644 index 0000000..0471d5e Binary files /dev/null and b/image/italyflag.png differ diff --git a/image/japan.png b/image/japan.png new file mode 100644 index 0000000..4fe1263 Binary files /dev/null and b/image/japan.png differ diff --git a/image/japanflag.png b/image/japanflag.png new file mode 100644 index 0000000..3b52dcc Binary files /dev/null and b/image/japanflag.png differ diff --git a/image/lasvegas.png b/image/lasvegas.png new file mode 100644 index 0000000..7a450f4 Binary files /dev/null and b/image/lasvegas.png differ diff --git a/image/logo.png b/image/logo.png new file mode 100644 index 0000000..c9ee1f1 Binary files /dev/null and b/image/logo.png differ diff --git a/image/mexico.png b/image/mexico.png new file mode 100644 index 0000000..d71ff5f Binary files /dev/null and b/image/mexico.png differ diff --git a/image/mexicoflag.png b/image/mexicoflag.png new file mode 100644 index 0000000..ebecbe8 Binary files /dev/null and b/image/mexicoflag.png differ diff --git a/image/miami.png b/image/miami.png new file mode 100644 index 0000000..025311e Binary files /dev/null and b/image/miami.png differ diff --git a/image/monaco.png b/image/monaco.png new file mode 100644 index 0000000..35536bb Binary files /dev/null and b/image/monaco.png differ diff --git a/image/monacoflag.png b/image/monacoflag.png new file mode 100644 index 0000000..087d872 Binary files /dev/null and b/image/monacoflag.png differ diff --git a/image/monza.png b/image/monza.png new file mode 100644 index 0000000..d7d9897 Binary files /dev/null and b/image/monza.png differ diff --git a/image/netherlands.png b/image/netherlands.png new file mode 100644 index 0000000..c3e7547 Binary files /dev/null and b/image/netherlands.png differ diff --git a/image/netherlandsflag.png b/image/netherlandsflag.png new file mode 100644 index 0000000..c18c1ce Binary files /dev/null and b/image/netherlandsflag.png differ diff --git a/image/qatar.png b/image/qatar.png new file mode 100644 index 0000000..6ee530e Binary files /dev/null and b/image/qatar.png differ diff --git a/image/qatarflag.png b/image/qatarflag.png new file mode 100644 index 0000000..47b246f Binary files /dev/null and b/image/qatarflag.png differ diff --git a/image/saudi.png b/image/saudi.png new file mode 100644 index 0000000..1550e08 Binary files /dev/null and b/image/saudi.png differ diff --git a/image/saudiflag.png b/image/saudiflag.png new file mode 100644 index 0000000..73ca2f7 Binary files /dev/null and b/image/saudiflag.png differ diff --git a/image/singapore.png b/image/singapore.png new file mode 100644 index 0000000..56cb0e8 Binary files /dev/null and b/image/singapore.png differ diff --git a/image/singaporeflag.png b/image/singaporeflag.png new file mode 100644 index 0000000..84bc027 Binary files /dev/null and b/image/singaporeflag.png differ diff --git a/image/spain.png b/image/spain.png new file mode 100644 index 0000000..26fd0a2 Binary files /dev/null and b/image/spain.png differ diff --git a/image/spainflag.png b/image/spainflag.png new file mode 100644 index 0000000..0253e4a Binary files /dev/null and b/image/spainflag.png differ diff --git a/image/usaflag.png b/image/usaflag.png new file mode 100644 index 0000000..0b7f491 Binary files /dev/null and b/image/usaflag.png differ diff --git a/images/logo.png b/images/logo.png new file mode 100644 index 0000000..c9ee1f1 Binary files /dev/null and b/images/logo.png differ diff --git a/images/pixel-lockscreen-clock.png b/images/pixel-lockscreen-clock.png new file mode 100644 index 0000000..fbefd42 Binary files /dev/null and b/images/pixel-lockscreen-clock.png differ diff --git a/images/vbs-task-scheduler.png b/images/vbs-task-scheduler.png new file mode 100644 index 0000000..794eee9 Binary files /dev/null and b/images/vbs-task-scheduler.png differ diff --git a/images/with-prayer.jpg b/images/with-prayer.jpg new file mode 100644 index 0000000..33ec3ab Binary files /dev/null and b/images/with-prayer.jpg differ diff --git a/images/without-prayer.jpg b/images/without-prayer.jpg new file mode 100644 index 0000000..ca0531f Binary files /dev/null and b/images/without-prayer.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..e88e5b0 --- /dev/null +++ b/index.html @@ -0,0 +1,48 @@ + + + + + +