-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Crucial-hash
committed
Apr 25, 2023
0 parents
commit f1d1bf8
Showing
60 changed files
with
623 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Kindle Paperwhite Clock</title> | ||
<link rel="icon" type="image/x-icon" href="/clock/image/logo.png"> | ||
<script src="script.js" defer></script> | ||
<link rel="stylesheet" href="style.css" | ||
<head> | ||
<body> | ||
<div class="track"> | ||
</div> | ||
|
||
<div class="sessions"> | ||
<p id="session"></p> | ||
</div> | ||
|
||
<div class="flag"> | ||
</div> | ||
|
||
<div class="raceweekend"> | ||
<p id="raceweekendtime"></p> | ||
</div> | ||
|
||
<div class="container"> | ||
<span id="hours"></span> | ||
</div> | ||
|
||
<div class="container1"> | ||
<span id="minutes"></span> | ||
</div> | ||
|
||
<div class="tracknamediv"> | ||
<span id="trackname"></span> | ||
</div> | ||
|
||
<script src="moment.min.js"></script> | ||
|
||
<button id="prayerbutton"></button> | ||
|
||
<div class="prayertextdiv" | ||
<p id="prayertext"></p> | ||
</div> | ||
|
||
</body> | ||
</head> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
1h 30m after race has finished show next race | ||
|
||
border of all images are 34 pixels | ||
|
||
flags need to be 2560x1536 and tracks are 997x749 (tracks are off official f1 page) | ||
|
||
03051630 - bahrain (below this time) | ||
|
||
03051630 - bahrain to saudi | ||
|
||
03191830 - saudi to australia | ||
|
||
04020730 - australia to azerbaijan (sprint) | ||
|
||
04301330 - azerbaijan to miami | ||
|
||
05072200 - miami to imola | ||
|
||
05211530 - imola to monaco | ||
|
||
05281530 - monaco to spain | ||
|
||
06041530 - spain to canada | ||
|
||
06182030 - canada to austria (sprint) | ||
|
||
07021530 - austria to britain | ||
|
||
07091630 - britain to hungary | ||
|
||
07231530 - hungary to belgium (sprint) | ||
|
||
07301530 - belgium to netherlands | ||
|
||
08271530 - netherlands to italy | ||
|
||
09031530 - italy to singapore | ||
|
||
09171430 - singapore to japan | ||
|
||
09240730 - japan to qatar (sprint) | ||
|
||
10081630 - qatar to united states (sprint) | ||
|
||
10222130 - united states to mexico | ||
|
||
10292130 - mexico to brazil (sprint) | ||
|
||
11051830 - brazil to las vegas | ||
|
||
11190730 - las vegas to abu dhabi |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.