rotten-reviews v2.3.3
rotten-reviews
Scrape audience reviews from Rotten Tomatoes 🍅
Description
This package fetches Rotten Tomatoes audience reviews (movies and TV shows) by scraping pages using cheerio and got. This project was bootstrapped with TSDX.
Note that this package doesn't use official packages or API endpoints provided by RT.
Usage
Adding to your project
Using
npmnpm install rotten-reviewsUsing
yarnyarn add rotten-reviews
Search titles using searchByQuery
Script
const { searchByQuery } = require('rotten-reviews') searchByQuery('venom').then(results => { console.log(JSON.stringify(results, null, 2)) })Output (truncated, fetched on December 20, 2018)
[ { "title": "Venom", "year": 2018, "type": "m", "slug": "m/venom_2018" }, { "title": "Venom", "year": 2016, "type": "m", "slug": "m/venom" }, ... ]
Fetch reviews using scrapeReviews
Script
const { scrapeReviews } = require('rotten-reviews') scrapeReviews('m/venom_2018').then(results => { console.log(JSON.stringify(results, null, 2)) })Output (truncated, fetched on December 20, 2018)
[ { "reviewer": "Cory L", "date": "December 19, 2018", "stars": 4, "review": "After watching the movie I gotta say it was good. It doesn't need spider Man though I would love to see that interaction. I am looking forward to seeing a sequel." }, { "reviewer": "Shawn R", "date": "December 19, 2018", "stars": 4, "review": "Critics be damned, I liked it. Lots of action, and it doesn't take itself too seriously. Venom was given a bit of personality rather than being a glorified sticky suit." }, ... ]
CLI usage
Starting from version 2, rotten-reviews does not include any runnables. Instead, we made rotten-reviews-cli which is a CLI wrapper for rotten-reviews.
Serverless deployment
Powered with ZEIT Now, we created a serverless deployment that you can consume to search and scrape on rotten-lambda.now.sh using these queries:
qto search titles (e.g.spider verse)sto scrape reviews using title slugs obtained from search (e.g.m/venom_2018)cto define how many to scrape (works only withs)
Example queries:
rotten-lambda.now.sh/?q=spider%20verseto search titlesrotten-lambda.now.sh/?s=m/venom_2018to scrape reviewsrotten-lambda.now.sh/?s=m/venom_2018&c=3to scrape only 3 first reviews
You can view the source code for the deployment on the demo directory or on the deployment source page.
API
Haven't done this part. Do submit a pull request if you want to contribute.
Related
murf- Metacritic Movie user review fetcher
License
MIT
