Live Reddit Comments is a Django web application which will allow a user to stream the newest comments from any Reddit submission, similar to live chat on Youtube.com or Twitch.com. This application utilizes the Reddit Python API library named PRAW - https://praw.readthedocs.io/en/stable/index.html
When the first comment in a new thread is a sticky comment a divide by zero error occurs.
raceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/max/PyEnvironment/LiveRedditComments/RedditComments/active_submissions_thread.py", line 28, in run
active_submissions.get_active_submissions()
File "/home/max/PyEnvironment/LiveRedditComments/RedditComments/active_submissions.py", line 88, in get_active_submissions
avg_time_dict[i] = avg_time_between_comments / num_comments
ZeroDivisionError: division by zero
Need to find local browser timezone and covert from UTC to local time.
Most likely this will have to be on on browser side JS code, will need to split response from server to only the time stamp and then convert it.