Coder Social home page Coder Social logo

maxkernchen / liveredditcomments Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 4.46 MB

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

License: MIT License

Python 99.34% CSS 0.03% PowerShell 0.28% Batchfile 0.02% HTML 0.11% JavaScript 0.21%
ajax django praw praw-reddit python3

liveredditcomments's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

liveredditcomments's Issues

Two browser sessions will share same submission id and comments cookie.

Two browser sessions will share same submission id and comments cookie.

Because the submission id and comments are stored in Django session storage, they are shared across tabs. Unless opened in incognito mode.

This cause two separate tabs with different submissions to display the same comments

Divide by zero error when first comment is stickied

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

All Comment Times are in UTC

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.