Which NFL Fanbases Cursed the Most During the Broncos and Steelers Divisional Playoff Game?

If you’re an avid Reddit user and football fan, you’ve probably come across the live game threads in r/nfl. This is a place where Redditors can post comments during the game and they can choose whether to represent their team using team logo flairs.

Here are the two threads for the Denver vs. Pittsburgh game that combined for over 25,000 comments from Redditors of all 32 NFL fanbases (and some users that choose not to represent any team).

  • Game Thread 1st Half
  • Game Thread 2nd Half
  • We thought it would be fun to scrape the threads during the game for comments that included a few choice 4-letter words and display that information in real-time by fanbase. Here’s what the final product looked like: Click here to view the Shiny Dashboard

    Here’s how we did it:

  • Set up a Python scraper on an EC2 AWS instance that uses PRAW to scrape Reddit every minute for new comments and store in a CSV file. Here’s a link to the code used for this portion: https://gist.github.com/tcash21/48bbba625d4e992d8d17
  • Push that comment file to S3 so that we can access it from ShinyApps.io.
  • Set up an R Shiny dashboard that groups the comments by team flair and displays them over time.
  • Use the Stattleship API to pull in live game stats, in this case we just pulled in home and away team scores
  • Deploy the R Shiny dashboard to shinyapps.io:
  • Here’s a link to the R code for both server.R and ui.R: https://gist.github.com/tcash21/1f87fd0c386237c36176
  • There were approximately 1,870 comments that included a few choice words and these were dominated by Broncos, Steelers and Patriots fans. If you’d like to play around with the raw comments data you can access the file here.

    What other live stats would you like to see updated during the Super Bowl? Tweet at us and maybe we will build it!

    For more information on building real-time interactive dashboards, please visit TCB Analytics and send us a message.

    Comments (0)

    Join the discussion, leave a reply!