Skip to content

Commit

Permalink
�[200~Added icon to html
Browse files Browse the repository at this point in the history
  • Loading branch information
Crucial-hash committed Apr 25, 2023
0 parents commit f1d1bf8
Show file tree
Hide file tree
Showing 60 changed files with 623 additions and 0 deletions.
152 changes: 152 additions & 0 deletions adhan.pyw
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 added fonts/Product Sans Bold Italic.ttf
Binary file not shown.
Binary file added fonts/Product Sans Bold.ttf
Binary file not shown.
Binary file added fonts/Product Sans Italic.ttf
Binary file not shown.
Binary file added fonts/Product Sans Regular.ttf
Binary file not shown.
Binary file added fonts/productsans.ttf
Binary file not shown.
Binary file added image/abudhabi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/abudhabiflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/australia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/australiaflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/austria.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/austriaflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/azerbaijan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/azerbaijanflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/bahrain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/bahrainflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/belgium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/belgiumflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/brazil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/brazilflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/britain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/britainflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/canada.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/canadaflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/cota.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/hungary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/hungaryflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/imola.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/italyflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/japan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/japanflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/lasvegas.png
Binary file added image/logo.png
Binary file added image/mexico.png
Binary file added image/mexicoflag.png
Binary file added image/miami.png
Binary file added image/monaco.png
Binary file added image/monacoflag.png
Binary file added image/monza.png
Binary file added image/netherlands.png
Binary file added image/netherlandsflag.png
Binary file added image/qatar.png
Binary file added image/qatarflag.png
Binary file added image/saudi.png
Binary file added image/saudiflag.png
Binary file added image/singapore.png
Binary file added image/singaporeflag.png
Binary file added image/spain.png
Binary file added image/spainflag.png
Binary file added image/usaflag.png
Binary file added images/logo.png
Binary file added images/pixel-lockscreen-clock.png
Binary file added images/vbs-task-scheduler.png
Binary file added images/with-prayer.jpg
Binary file added images/without-prayer.jpg
48 changes: 48 additions & 0 deletions index.html
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>
51 changes: 51 additions & 0 deletions info.txt
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
2 changes: 2 additions & 0 deletions moment.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit f1d1bf8

Please sign in to comment.