Greasy Fork

来自缓存

Greasy Fork is available in English.

RottenTomatoes Utility Library

Utility library for grabbing info from rottentomatoes.com

当前为 2019-09-06 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/389810/731011/RottenTomatoes%20Utility%20Library.js

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
driver8
版本
0.1.1
创建于
2019-09-06
更新于
2019-09-06
大小
5.2 KB
许可证
暂无

Provides three functions:


getRtIdFromTitle(title[, tv[, year]])

Searches for a movie (or TV show) with the given title (and optionally year) and returns the RottenTomatoes ID (e.g. "/m/serenity") for the best match.

title: title of the movie or show to search for
tv: is it a TV show? (default: false)
year: year it was published (optional)



getRtInfoFromId(id):

Given a RottenTomatoes ID (e.g. "/m/serenity"), looks up that movie or TV show (returns info for the first season) and returns an object with the following properties:

id: RottenTomatoes ID (e.g. "/m/serenity")
score: Tomatometer rating (e.g. 78%)
rating: Average numerical rating from critics, out of 10
votes: Number of critics counted
consensus: Blurb describing critics' consensus
state: "rotten", "fresh, "certified_fresh", or not defined
topScore: Tomatometer rating from only "top" critics (e.g. 78%)
topRating: Average numerical rating from only "top" critics, out of 10
topVotes: Number of "top" critics counted
year: Release year according to RottenTomatoes
fetched: Date data was fetched (now)



getRtInfoFromTitle(title[, tv[, year]])

Searches for a movie with the given title (and optionally year, or TV show) using getRtIdFromTitle and returns the data from getRtInfoFromId for the best match.

title: title of the movie or show to search for
tv: is it a TV show? (default: false)
year: year it was published (optional)


Examples:

getRtInfoFromTitle('serenity', false, 2005);

Returns:

{
  "id": "/m/serenity",
  "score": 83,
  "rating": 7.17,
  "votes": 185,
  "consensus": "Snappy dialogue and goofy characters make this Wild Wild West soap opera in space fun and adventurous.",
  "state": "certified_fresh",
  "topScore": 85,
  "topRating": 7.03,
  "topVotes": 40,
  "year": 2005,
  "fetched": "2019-09-06T02:39:37.017Z"
}

getRtInfoFromTitle('my hero academia', true, 2016);

Returns:

{
  "id": "/tv/my_hero_academia",
  "score": 100,
  "rating": 8.67,
  "votes": 9,
  "consensus": null,
  "state": "fresh",
  "topScore": null,
  "topRating": null,
  "topVotes": null,
  "year": 2016,
  "fetched": "2019-09-06T02:35:29.336Z"
}

getRtIdFromTitle('serenity')

Returns:

'/m/serenity'