Coder Social home page Coder Social logo

metacritic_api's Introduction

metacritic_api

Python API for Metacritic.com

Currently, the API can grab scores for any category. Some functions:

searchFirstResult: searches for the query and grabs the first result off the list -by searching first, the query is a little slower due to the extra HTTP request and parsing through an extra page, but this also allows people to incorrectly type titles and still get (most likely) the response they were looking for.

searchTVSeries: searches for the query and grabs the entire TV series. Returns a list of TVCriticInfo instances. -uses searchFirstResult and from Season 1 grabs the rest of the TV series through links.

I tried to abstract this as much as possible so that if anyone else wanted to make additions it would be easier. Currently, scores are pulled from the details page rather than the front page. That's an easy fix if someone thinks it would be better use the front page rather than the details page.

Some classes:

MetaCriticInfo: base class that is initialized with arguments title, type, link (to page)

  • upon initialization, the class loads the page using the link and grabs extra data (criticscore, userscore, releaseDate, summary)
  • all scores are averaged to the 100 scale - this doesn't really affect the criticscore, but the userscore is multiplied by a factor of ten to place it even with the criticscore.

TVCriticInfo: derived class of MetaCriticInfo

  • initialization grabs extra data - really just the season title (Name: Season 1, Name: Season 2, etc.)

TVSeriesInfo:

  • class that holds a list of TVCriticInfo(s)
  • initialized by title, type, link (to page) - the link to the page is automatically directed to the first season
  • from the first season we can grab links to all of the other seasons and append each season to the list, I did this using threading to speed up the initialization. It's only slightly faster I think. Because I use threading, the initialization sorts the series according to season title.

To Do:

  • maybe add a little more multithreading
  • definitely speed up
  • return output as JSON rather than python objects

metacritic_api's People

Contributors

khangsile 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.