Coder Social home page Coder Social logo

snldb's Introduction

snldb

This project aims to scrape a Saturday Night Live database from the web. For now the following sources were used:

Thanks to Joel Navaroli (@snlmedia) for creating the awesome archive that is snlarchives.net. Please visit the site to answer all of your questions about snl.

What's missing from the archive is some analysis. That why I created this project. I wanted to answer questions like:

  • How have the ratings developed over the years?
  • Which actors had the biggest presence on the show (most titles per episode on average)?
  • Which actor had the most appearances in a single episode?

If you have some ideas for other questions to answer, just send them to me or play with the data yourself.

Where is the data

If you are only interested in the data you can find it in the output folder. However we will not guarantee that the data is up to date. If you want a fresh dataset you should crawl the data yourself or look at the kaggle dataset page.

How to crawl fresh data

To use the scrapy crawler, make sure you've first installed the modules listed in requirements.txt (pip install -r requirements.txt). We recommend using Python 3 (at time of writing, Python 2 also works, but isn't officially supported).

After that you can test everything by running

./crawl_single_episode.sh

The folder single_ep_output should now contain json files with the crawled data for one episode.

To perform a complete crawl, run

./crawl_all.sh

This will overwrite the json files in the output folder.

You can convert the json files to csvs by running

python convert_json_to_csv.py

This should place the corresponding .csv files next to the .json files in the output directory.

Development

There are some unit tests in the snlscrape package which can by run by invoking pytest from the project root.

crawl_single_episode.sh takes an episode id as an optional command-line argument (e.g. ./crawl_single_episode.sh 20130511), which can be useful for debugging. For debugging parsing issues, the scrapy shell command is highly useful (e.g. scrapy shell http://www.snlarchives.net/Cast/?KrWi).

Contact us

If you have any ideas of how to improve this project or if you have new questions you want to answer with the data don't hesitate to contact us.

Hendrik Hilleckes (@hhllcks, [email protected], blog.hhllcks.de )

Colin Morris (http://colinmorris.github.io/)

snldb's People

Contributors

colinmorris avatar hhllcks 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.