Giter Site home page Giter Site logo

belgiangeek / rotten-parser Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 36 KB

A simple Rottentomatoes.com webscraper built on top of Puppeteer, Axios and Cheerio

License: GNU General Public License v3.0

JavaScript 100.00%
rotten-tomatoes rottentomatoes movies movie-reviews movie-ratings

rotten-parser's Introduction

Intro

Rotten-parser is Node.js-compatible module allowing you to fetch data from Rottentomatoes in a very simple way. This package is built on top of Cheerio, Puppeteer and axios.

Installation (Jedis can skip this step ๐Ÿ˜Ž)

First, you have to get the package from the npm registry by typing npm install --save rotten-parser or yarn add rotten-parser in your terminal/console. Then you have to include it in your code using a require statement as shown below :

const rotten-parser = require('rotten-parser');

Features

Currently there are only two functions available :

getMovieReview(title)

This function returns basic info about the movie title given as argument. The return statement is an object similar to the following :

{
  // The movie title as shown on the website
  title: 'Ex Machina',

  // The overall critics rating
  rating: '92%',

  // The audience score
  audienceScore: '86%',

  // The critics consensus
  consensus: "Ex Machina leans heavier on ideas than effects, but...",

  // The movie synopsis (250 characters long)
  synopsis: "Caleb Smith (Domhnall Gleeson) a programmer at a huge Internet company...",

  // The poster URL
  poster: 'https://resizing.flixster.com/kMP9ZfwTENlp99G4u66DbL6RtQk=/206x305/v2/https://flxt.tmsimg.com/assets/p11007806_p_v10_ag.jpg',

  // The complete review URL on the rottentomatoes website
  url: 'https://rottentomatoes.com/m/ex_machina'
}

getOpenings()

This one does not accept arguments. It returns an object similar to the following :

{
  // The movie review URL on the rottentomatoes website
  link: 'https://www.rottentomatoes.com//m/woman_in_motion',

  // The movie poster URL
  poster: 'https://resizing.flixster.com/hmuV3hJIv19p9GdEBWkhFfQ_DA4=/180x257/v2/https://resizing.flixster.com/XdBXG5iWPN9rIbTLBu6ga0f9s2M=/ems.ZW1zLXByZC1hc3NldHMvbW92aWVzL2ZjYjcxNzdmLTgxZmEtNDM2Ni1hMzUyLTVjMmU1OTJjMzllYS5qcGc=',

  // Its release date (if known)
  releaseDate: 'No release date known yet...',

  // The movie title
  title: 'Woman in Motion',

  // The critics consensus
  consensus: "Nichelle Nichols' daunting task to launch a national blitz for NASA. Nichelle recruited many trailblazing astronauts who became the first African American, Asian and Latino people to fly in space.",

  // Some additional info
  additionalInfo: '1hr 35min'
}  

Usage

Each of those functions returns a promise, like the following :

const rotten = require('rotten-parser');

rotten.getOpenings()
  .then(data => console.log(data))
  .catch(err => console.error(err));

Contributions

Any help is welcome ! You can open an issue or a pull request to get started and we'll get in touch.

License

This code is licensed under the GNU GPL v3 license.

rotten-parser's People

Contributors

belgiangeek avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 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.