Skip to content
Permalink
Browse files

Merge pull request #80 from ninetwenty-one/tsdx-rewrite

  • Loading branch information...
grikomsn committed Aug 28, 2019
2 parents 965c455 + 6369993 commit 0184f017140049a824c8bf0a4ed1412f97b2430a
@@ -0,0 +1,17 @@
root = true

[*]
indent_style = space
indent_size = 2

end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[package.json]
indent_style = space
indent_size = 2

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,3 +1,7 @@
*.log
.DS_Store
dist
node_modules
.rts2_cache_cjs
.rts2_cache_esm
.rts2_cache_umd
dist

This file was deleted.

@@ -1,7 +1,10 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
{
"bracketSpacing": true,
"endOfLine": "crlf",
"jsxBracketSameLine": false,
"parser": "babel",
"printWidth": 80,
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
42 LICENSE
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2018 Nine Twenty One

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2019 Nine Twenty One
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -1,3 +1,5 @@
<!-- markdownlint-disable MD033 -->

<div align='center'>

# rotten-reviews
@@ -6,7 +8,6 @@ Scrape audience reviews from [Rotten Tomatoes](https://www.rottentomatoes.com)

[![NPM version](https://img.shields.io/npm/v/rotten-reviews.svg)](https://www.npmjs.com/package/rotten-reviews)
[![NPM download count](https://img.shields.io/npm/dt/rotten-reviews.svg)](https://www.npmjs.com/package/rotten-reviews)
[![Greenkeeper badge](https://badges.greenkeeper.io/ninetwenty-one/rotten-reviews.svg)](https://greenkeeper.io/)
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/ninetwenty-one/rotten-reviews)

[![Rotten GIF](https://media.giphy.com/media/101t9QwTM6y5oc/giphy.gif)](https://spectrum.chat/ninetwenty-one/rotten-reviews)
@@ -19,19 +20,14 @@ Scrape audience reviews from [Rotten Tomatoes](https://www.rottentomatoes.com)
- [Search titles using `searchByQuery`](#search-titles-using-searchbyquery)
- [Fetch reviews using `scrapeReviews`](#fetch-reviews-using-scrapereviews)
- [CLI usage](#cli-usage)
- [Lambda Deployment](#lambda-deployment)
- [Serverless deployment](#serverless-deployment)
- [API](#api)
- [Related](#related)
- [License](#license)

## Description

This Node.js package fetches [Rotten Tomatoes](https://www.rottentomatoes.com) audience reviews (movies and TV shows) by scraping pages using [`cheerio`](https://github.com/cheeriojs/cheerio) and [`node-fetch`](https://github.com/bitinn/node-fetch). Notable features such as:

- Search movie or TV show titles
- Fetch whole audience reviews or by defined value
- Compiled from Typescript to CommonJS and ES modules
- Typescript declaration file available
This package fetches [Rotten Tomatoes](https://www.rottentomatoes.com) audience reviews (movies and TV shows) by scraping pages using [`cheerio`](https://github.com/cheeriojs/cheerio) and [`got`](https://github.com/sindresorhus/got). This project was bootstrapped with [TSDX](https://github.com/jaredpalmer/tsdx).

Note that this package doesn't use official packages or API endpoints provided by RT.

@@ -56,12 +52,8 @@ Note that this package doesn't use official packages or API endpoints provided b
- Script

```js
// using require (commonjs)
const { searchByQuery } = require('rotten-reviews')
// using import (es module)
import { searchByQuery } from 'rotten-reviews'
searchByQuery('venom').then(results => {
console.log(JSON.stringify(results, null, 2))
})
@@ -92,12 +84,8 @@ Note that this package doesn't use official packages or API endpoints provided b
- Script

```js
// using require (commonjs)
const { scrapeReviews } = require('rotten-reviews')
// using import (es module)
import { scrapeReviews } from 'rotten-reviews'
scrapeReviews('m/venom_2018').then(results => {
console.log(JSON.stringify(results, null, 2))
})
@@ -127,9 +115,9 @@ Note that this package doesn't use official packages or API endpoints provided b

Starting from version 2, `rotten-reviews` does not include any runnables. Instead, we made [`rotten-reviews-cli`](https://github.com/ninetwenty-one/rotten-reviews-cli) which is a CLI wrapper for `rotten-reviews`.

### Lambda Deployment
### Serverless deployment

Powered with [Zeit Now](https://zeit.co/now), we created a lambda deployment that you can consume to search and scrape on [`rotten-lambda.now.sh`](https://rotten-lambda.now.sh) using these queries:
Powered with [ZEIT Now](https://zeit.co/now), we created a serverless deployment that you can consume to search and scrape on [`rotten-lambda.now.sh`](https://rotten-lambda.now.sh) using these queries:

- `q` to search titles (e.g. `spider verse`)
- `s` to scrape reviews using title slugs obtained from search (e.g. `m/venom_2018`)

This file was deleted.

This file was deleted.

1 comment on commit 0184f01

Please sign in to comment.
You can’t perform that action at this time.