模板:Rotten Tomatoes data
| File:Lua-Logo.svg | 此模板使用Lua語言: |
Rotten Tomatoes data retrieves (the most recent) Rotten Tomatoes data from Wikidata. Currently available only for movies.
For this template to work properly, the Wikidata item to be accessed should have Rotten Tomatoes data available, e.g. as shown here.
Usage[編輯]
{{Rotten Tomatoes data|command|qid=...}}
{{Rotten Tomatoes data|command|title=...}}
Command options are described in § Examples. The optional parameter qid should be the Q-identifier of the Wikidata item to be accessed, e.g. Q943338. Alternatively, one can use the parameter title which should be the title of the Wikipedia article whose connected Wikidata item is to be accessed, e.g. American Psycho (film). By default, when neither qid nor title are provided, the item connected to the current article is accessed.
For this template to work properly, the Wikidata item to be accessed should have Rotten Tomatoes data available, e.g. as shown here. An error message is produced for missing data. See Wikipedia:Wikidata § Access from Wikipedia for how to access the Wikidata item connected to an article.
Examples[編輯]
In the following examples we use the film Hitch which has a corresponding Wikidata item Module:Wikibase第27行Lua錯誤:attempt to call field 'label' (a nil value) (Q943338).
- The
scorecommand produces the Tomatometer score.{{Rotten Tomatoes data|score|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
- The
titleof a Wikipedia article can be given instead ofqid.{{Rotten Tomatoes data|score|title=Hitch (film)}}⇒ Article "Hitch (film)" does not exist or has no Wikidata item.
- The
countcommand produces the number of critic reviews. The parameterspellcan be used to apply {{Spellnum per MOS}} to the count.{{Rotten Tomatoes data|count|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value){{Rotten Tomatoes data|count|spell=y|title=Meadowland (film)}}⇒ Article "Meadowland (film)" does not exist or has no Wikidata item.
- The
averagecommand produces the average rating.{{Rotten Tomatoes data|average|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
- The
tablecommand is convenient for use in tables to provide a quick overview of a score and reviews.{{Rotten Tomatoes data|table|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
- The
access date(oraccessdateoraccess-date) command produces the Module:Wikibase第27行Lua錯誤:attempt to call field 'label' (a nil value) (P813) date from the reference if it exists, and otherwise produces the Module:Wikibase第27行Lua錯誤:attempt to call field 'label' (a nil value) (P585) if it exists.{{Rotten Tomatoes data|access date|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value){{Rotten Tomatoes data|access date|df=dmy|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value){{Rotten Tomatoes data|access date|df=ymd|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value){{Rotten Tomatoes data|access date|df=iso|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
- The
datecommand produces the Module:Wikibase第27行Lua錯誤:attempt to call field 'label' (a nil value) (P585) if it exists, and otherwise produces the Module:Wikibase第27行Lua錯誤:attempt to call field 'label' (a nil value) (P813) date from the reference if it exists. Use theaccess datecommand for citations. Thedatecommand exists mostly in case the Module:Wikibase第27行Lua錯誤:attempt to call field 'label' (a nil value) (P585) differs from the Module:Wikibase第27行Lua錯誤:attempt to call field 'label' (a nil value) (P813) date for some reason.{{Rotten Tomatoes data|date|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
- The
as of(orasof) command wraps the template {{As of}}, except that any values given for the year, month, and day parameters are converted to the corresponding value from thedatecommand.{{Rotten Tomatoes data|as of|year|month|day|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value){{Rotten Tomatoes data|as of|y|m|d|lc=y|df=us|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value){{Rotten Tomatoes data|as of|a|b|lc=y|df=us|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
- The
prosecommand produces the result of the template {{Rotten Tomatoes prose}} with autofilled parameters.{{Rotten Tomatoes data|prose|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
- The
rtidcommand produces the item's Module:Wikibase第27行Lua錯誤:attempt to call field 'label' (a nil value) (P1258) value.{{Rotten Tomatoes data|rtid|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value){{Rotten Tomatoes data|rtid|noprefix=y|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
- The
urlcommand produces the full Rotten Tomatoes URL using the item's Module:Wikibase第27行Lua錯誤:attempt to call field 'label' (a nil value) (P1258) value and the property's formatter URL.{{Rotten Tomatoes data|url|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
- The
editcommand wraps the template {{EditAtWikidata}}, linking topid=P444.{{Rotten Tomatoes data|edit|qid=Q943338}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
Error detection[編輯]
Certain errors are reported for missing/faulty parameters and data. For example:
{{Rotten Tomatoes data|count}}⇒ No Wikidata item connected to current page. Need qid or title argument.{{Rotten Tomatoes data|count|title=Apple Apple Apple}}⇒ Article "Apple Apple Apple" does not exist or has no Wikidata item.{{Rotten Tomatoes data|score|qid=Q2}}⇒ Module:Rotten_Tomatoes_data第153行Lua錯誤:attempt to call field 'isValidEntityId' (a nil value)
TemplateData[編輯]
| ⧼templatedata-doc-param-name⧽ | ⧼templatedata-doc-param-desc⧽ | ⧼templatedata-doc-param-type⧽ | ⧼templatedata-doc-param-status⧽ | |
|---|---|---|---|---|
| Command | 1 | Command which tells this template what value to return. For usage examples and explanations, see the full documentation at "Template:Rotten Tomatoes data/doc". The "score" command returns the Tomatometer score, e.g. 99%. The "count" command returns the number of reviews, e.g. 112. The "average" command returns the average rating, e.g. 5.5/10. The "table" command returns the score and count in the format "XX% (YYY reviews)". The "rtid" command returns the Rotten Tomatoes ID, e.g. m/titanic. The "url" command returns the url, e.g. https://www.rottentomatoes.com/m/titanic. The "date" command returns the date on which the Tomatometer score was accurate, e.g. October 1, 2021. The "access date" command returns the date on which the Tomatometer score was retrieved and added to Wikidata, e.g. October 1, 2021. The "as of" command turns the rest of this template into a wrapper for "Template:As of" and returns the result of that template, except that any values given for the year, month, or day are converted to the corresponding value from the "date" command. The "prose" command returns the result of "Template:Rotten Tomatoes prose" with autofilled parameters. The "edit" command returns the result of "Template:EditAtWikidata", linked to property P444.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-required⧽ |
| Date format | df | Date format for the "date" and "access date" commands. Options are "mdy" (May 4, 2021), "dmy" (4 May 2021), "iso" (2021-05-04), and "ymd" (2021 May 4). If omitted, the "mdy" format is used.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-optional⧽ |
| No prefix for rtid | noprefix | Removes the Rotten Tomatoes ID prefix (e.g. "m/") when used with the "rtid" command. Give this parameter any value to remove the prefix.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-optional⧽ |
| Spell out the count | spell | Wraps the count with "Template:Spellnum per MOS" when used with the "count" command. Give this parameter any value to activate the wrapping.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-optional⧽ |
| Wikidata Q-identifier | qid | Q-identifier of the Wikidata item to be accessed. If both "qid" and "title" are omitted, the item connect to the current page is accessed. Only one of the parameters "qid" and "title" should be used.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-optional⧽ |
| Title of article | title | Title of the Wikipedia article whose connected Wikidata item is to be accessed. If both "qid" and "title" are omitted, the item connect to the current page is accessed. Only one of the parameters "qid" and "title" should be used.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-optional⧽ |
See also[編輯]
Other templates:
FAQ for Rotten Tomatoes: