Git Product home page Git Product logo

metacritic-scraper's Introduction

metacritic-scraper

Metacritic Scraper is a library that scrapes data about albums, tv shows, movies and persons. These data include user/critic review, review counts, credits, image url for the item thumbnail, etc.

This project is built using the .Net Framework v 4.6.1

API

Check the API built using this library at https://github.com/marcalencc/metacritic-api/blob/master/README.md

NuGet

How to Use

Create an instance of WebScraper class

IScraper m_metacriticScraper = new WebScraper(ResponseChannel, limit);
  • 'limit' is the number of request that can be processed simultaneously.
  • 'ResponseChannel' is the callback that will receive all the responses. It follows the following signature:
Action<string, IMetacriticData[]>

To add a request, call the 'AddItem' function.

 m_metacriticScraper.AddItem(id, url);
  • 'id' is a user provided string that can be used to identify which responses are from which requests.
  • 'url' can be any of the following:
/search/<dash-separated-search-string>/<mediaType>
* Multiple search strings (e.g. 'awake-dead') means all the strings should appear in the media item title.
* You can specify limit and offset on search requests. Default and maximum limit is 20. Default offset is 0. (see below)

/search/<dash-separated-search-string>/<mediaType>?limit=15&offset=21
/search/<dash-separated-search-string>/<mediaType>?offset=15
/search/<dash-separated-search-string>/<mediaType>?limit=10

/person/<dash-separated-name>/<mediaType>

* Search and person responses include an Id field which can be used in album, tvshow and movie requests (see below)
Sample Search Response: 
         {  
            "Id":"/movie/amityville-the-awakening",
            "Title":"Amityville: The Awakening",
            "ReleaseDate":"PG-13",
            "Genre":"Thriller, Horror",
            "Rating":{  
               "CriticRating":0
            }
         }
         
Sample Person Response:
          {  
            "Credit":"Primary Artist",
            "Item":{  
               "Id":"/album/bangerz",
               "Title":"Bangerz",
               "ReleaseDate":"10/08/2013",
               "Rating":{  
                  "CriticRating":61,
                  "UserRating":6.9
               }
            }
         }

* Alternatively, just plug in the dash separated title on the media requests

/<mediaType>/<dash-separated-title>
/<mediaType>/<dash-separated-title>/<year>
/<mediaType>/<dash-separated-title>/<details>
/<mediaType>/<dash-separated-title>/<year>/<details>

<mediaType> = album|tvshow|movie
<year> = specify the release year e.g (2015) or season for tv shows e.g. (6) to filter the results
<details> = to get the item credits instead of the item info and reviews

Note: If the name or title has a '-', prefix it with a '~' e.g (/person/jay~-z/album)

All responses will be routed to the callback set during instantiation.

        public void ResponseChannel(string id, IMetacriticData[] responses)
        {
                ...
        }
  • id is the id set when the request is added so be sure to keep track of them
  • responses is an array of responses of type IMetacriticData. It can be an album, tvshow, movie, person or an error.

Sample Implementation

For a complete sample implementation, check
https://github.com/marcalencc/metacritic-api/blob/master/MetacriticAPI/Services/MetacriticService.cs

This is from an API that I built using this project.

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.