8
8
WEDNESDAY_DATETIME_DAY = 2
9
9
END_DATE_WEEKS = 4 # Number of weeks to skip
10
10
11
+ DATE_FORMAT = "%Y-%m-%d"
11
12
START_URL_ENCODING = "T03%3A00%3A00-05%3A00" #T03:00:00
12
13
END_URL_ENCODING = "T02%3A59%3A00-05%3A00" #T02:59:00
13
14
EVENT_TYPES = [
@@ -58,11 +59,11 @@ def get_formatted_dates():
58
59
"""
59
60
60
61
start , end = get_desired_date_range ()
61
- start_year , end_year = str ( start . year ), str ( end . year )
62
- start_month , end_month = str ( start .month ). zfill ( 2 ), str ( end . month ). zfill ( 2 ) # left padding with 0s
63
- start_day , end_day = str ( start . day ). zfill ( 2 ), str ( end .day ). zfill ( 2 ) # left padding with 0s
62
+
63
+ formatted_start = f" { start .strftime ( DATE_FORMAT ) } { START_URL_ENCODING } "
64
+ formatted_end = f" { end .strftime ( DATE_FORMAT ) } { END_URL_ENCODING } "
64
65
65
- return f" { start_year } - { start_month } - { start_day } { START_URL_ENCODING } " , f" { end_year } - { end_month } - { end_day } { END_URL_ENCODING } "
66
+ return formatted_start , formatted_end
66
67
67
68
def get_urls ():
68
69
urls = []
@@ -87,11 +88,13 @@ def main():
87
88
urls = get_urls ()
88
89
89
90
# TODO: Auto parse results... For now, generates an HTML page of links to use
91
+ CUTOFF_POINT = 160 # Skips all portions of URL up to the location + in-person/online
92
+
90
93
date_title = str (datetime .datetime .today ().strftime ("%m_%d_%Y" ))
91
94
with open (f'{ date_title } .html' , 'w' ) as f :
92
95
f .write (f'<p>{ date_title } </p>\n <br>\n ' )
93
96
for i , url in enumerate (urls ):
94
- text_line = url [160 :]
97
+ text_line = url [CUTOFF_POINT :]
95
98
f .write (f'<a href="{ url } " target="_blank">{ text_line } </a>\n <br>\n <br>\n ' )
96
99
97
100
if __name__ == '__main__' :
0 commit comments