Scrape audience reviews from Rotten Tomatoes ๐
This Node.js scrapes Rotten Tomatoes audience reviews pages and scrapes the contents by getting the reviewer name, date, total stars, and review excerpt.
Future features are listed on the roadmap.
- Node.js
All binaries are compiled using pkg
using Node.js v8.12.0
.
See the releases page for the binaries' download links.
Example running the binaries on darwin
:
$ ./rotten-reviews-macos
Usage: rotten-reviews [options] <showtype> <title> <pages>
scrapes audience movie reviews from rotten tomatoes
Options:
--csv exports to csv (defaults to json)
-h, --help output usage information
- Install package globally by running:
# install using npm
npm -g i rotten-reviews
# install using npm
yarn global add rotten-reviews
- Run
rotten-reviews
with thetv/m
,movieSlug
andpages
parameter, for example:
$ rotten-reviews m venom_2018 25
[
{
"reviewer": "Melissa B",
"date": "October 11, 2018",
"stars": 5,
"review": "I loved it! Didn't expect to like it as much as I did.Some really funny parts and amazing action scenes. Ignore the critics, go see it!"
},
{
"reviewer": "Andrew O",
"date": "October 11, 2018",
"stars": 2.5,
"review": "Despite a surprising amount of humor and chemistry between Venom and his host, Venom is mostly inept as both an action and a horror film, with only the slightest amount of soul peering through the thoughtful characterization of Hardy's role. This is a movie you can enjoy while watching and forget the moment you're done."
},
...
For tv shows, please specify the season e.g. rotten-reviews tv doctor_who/s11 25
.
-
Install package by running:
# install using npm npm i rotten-reviews # install using npm yarn add rotten-reviews
-
Example usage source code:
// import the package const RottenReviews = require('rotten-reviews') // https://www.rottentomatoes.com/m/venom_2018/reviews const movieSlug = 'venom_2018' const showType = 'm' // get 500 reviews (20 per page * 25) const pages = 25 // get using the getAudienceReviews function RottenReviews.getAudienceReviews(showType, movieSlug, pages).then(reviews => { console.log(JSON.stringify(reviews, null, 4)) })
-
Here's the result of the source code above:
[ { "reviewer": "Melissa B", "date": "October 11, 2018", "stars": 5, "review": "I loved it! Didn't expect to like it as much as I did.Some really funny parts and amazing action scenes. Ignore the critics, go see it!" }, ... ]
- Scrape defined number of reviews instead of pages
- Error handling if movie page doesn't exist
- Include scraping TV series reviews
axios
for fetching webpagescheerio
for scraping the webpage contentscommander.js
for running this package as a CLI appjson2csv
for converting scraped reviews to CSV on the CLI apppkg
for compiling to binaries
MIT