Coder Social home page Coder Social logo

reddit-sentiment's Introduction

Reddit Sentiment Analysis Dash Application

1st command pmt type - python Reddit_Stream.py
2nd command pmt type - python app.py runserver

Live-streaming sentiment analysis application created with Python and Dash, hosted at sentiment-reddit.herokuapp.com.

Repo Contents:

  • app.py - The main front-end application code. Contains the dash application layouts, logic for graphs, interfaces with the database...etc. If you want to clone this and run it locally, you will be using the python app.py runserver
  • reddit_stream.py - This should run in the background of your application. This is what streams threads, comments, replies from subreddit /worldnews, storing them into the postgresql database, which is what the app.py file interfaces with.
  • db-truncate.py - A script to truncate the infinitely-growing postgresql database.

Quick start

  • Clone repo
  • install requirements.txt using pip install -r requirements.txt
  • Create an API on reddit.
  • Fill in your Reddit API credentials to reddit_stream.py.
  • Setup postgresql credentials. or to run locally on sqlite database, replace psycorg2.connect(... with conn = sqlite3.connect("reddit.db").
  • Run reddit_stream.py to build database
  • You might need the latest version of sqlite.
  • Run app.py to run the app.
  • Consider running the db-truncate.py from time to time (or via a cronjob), to keep the database reasonably sized. In its current state, the database really doesn't need to store more than 2-3 days of data most likely.

Credits

The most credit goes to Sentdex who inspired me to create this app.

reddit-sentiment's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.