Skip to content

amyyq2/CourseProject

 
 

Repository files navigation

CourseProject: Chrome Extension that analyzes the sentiment of comments on a page of Youtube videos

Video Tutorial: https://drive.google.com/file/d/1DyVwC1LILAxA8Otna0wsqkc5GQsomNcI/view?usp=sharing

Getting Started

Install ChromeDriver:

Dependencies (Run these commands in terminal in the repo after you clone it)

Install selenium:

  • pip install selenium

Install pandas:

  • pip install pandas

Install vaderSentiment:

  • pip install vaderSentiment

Install nltk:

  • pip install nltk

To execute the code

Initial Steps

  1. Clone this repository in a location you will remember.
  2. Open up a Chrome browser

Add the Rice extension to Chrome

  1. Click on the extensions button in the top right corner.
    Screen Shot 2021-12-08 at 1 18 06 PM
  2. Click on "Manage Extensions". This should open another tab.
  3. You should toggle the "Developer Mode" in the top right corner of the page.
    Screen Shot 2021-12-08 at 1 23 44 PM
  4. Click "Load unpacked".
    Screen Shot 2021-12-08 at 1 23 34 PM
  5. Navigate to the repository that you cloned and then click into the folder called "chrome_extension". Click the blue select button
  6. Now you should see this in your extensions
    Screen Shot 2021-12-08 at 1 28 00 PM
  7. You need to now click on the extensions button again in the top right corner and pin Rice to your browser bar.
    Screen Shot 2021-12-08 at 1 28 42 PM

Try the extension out!

  1. Open up a Chrome browser to any youtube channel. Navigate to the videos tab of the channel. Your url should look something like "youtube.com/c/username/videos"
  2. Open the terminal and navigate to the repository you cloned. You should be in /path/to/CourseProject
  3. Run the server by running this line of code in the terminal python3 comments_scraping.py
  4. Once you see the message "Server started http://localhost:8080", go to your chrome tab with the youtube channel videos
  5. Click on the Rice extension icon in the top right corner. You should see a square with a button in the middle.
    Screen Shot 2021-12-08 at 1 35 22 PM
  6. Click the center button and wait for your results! Give it at least 1.5 minutes to ensure it works.
  7. You might see something like this:

    264590379_1007285726669890_6546290131030666602_n

    • A video title highlighted in red means the video's comment section contains an average negative sentiment
    • A video title highlighted in green means the video's comment section contains an average positive sentiment
    • A video title highlighted in blue menas the video's comment section contains an averager neutral sentiment
    • Note: The darker the color the more positive/negative the comments' average sentiment is

NOTE: User of extension must restart server code every time the channel is refreshed or navigated to a new channel. They can do this by executing the following commands in the terminal where the server is running:

  1. ^C
  2. python3 comments_scraping.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 60.2%
  • JavaScript 34.8%
  • HTML 3.4%
  • CSS 1.6%