-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmorning.py
40 lines (29 loc) · 1.03 KB
/
morning.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import time
import webbrowser
# Websites to be opened for the morning routing
MORNING_LIST = [
# Self-organization
'https://todoist.com/app/',
# Global
'/~https://github.com/',
'https://dev.to/',
'https://www.developpez.com/',
'https://www.linkedin.com/',
# Random
'https://www.reddit.com/r/ProgrammerHumor/',
'https://www.monkeyuser.com/',
'https://www.commitstrip.com/fr/',
'https://arcaderage.co/',
]
def open_site(url: str, delay: int = .1) -> None:
"""Open the provided url in a new tab
Afterward, the program will halt for :paramref delay: seconds so that the
browser can handle and proceed the request without opening a new window
:param url: (str) url to be opened
:param delay: (int) number of seconds to be awaited (default .1)
"""
webbrowser.open_new_tab(url)
print('[INFO] - opening ' + url)
time.sleep(delay)
if __name__ == "__main__":
[open_site(website, 1) if website == MORNING_LIST[1] else open_site(website) for website in MORNING_LIST]