Jump to content

Template:Douban/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎Parameters: The JSON info table well updated base on the current Template data.
Tags: Reverted Mobile edit Mobile web edit Advanced mobile edit
Restored revision 920652787 by Jonesey95 (talk): Do not use mobile site directly
Tags: Twinkle Undo Reverted
Line 5: Line 5:
Go to [https://www.douban.com/ Douban.com] ([[Douban]]), search and find the page of the work that you are looking for, check out its URL.
Go to [https://www.douban.com/ Douban.com] ([[Douban]]), search and find the page of the work that you are looking for, check out its URL.


'''1. If it is a movie or celebrity''', then the URL should be like <code><nowiki>https://m.douban.com/movie/subject/[movieID]/</nowiki></code> <br>
'''1. If it is a movie''', then the URL should be like <code><nowiki>https://movie.douban.com/subject/[ID]/</nowiki></code>. In a Wikipedia article you may insert the code below
Or
<code>
<nowiki>https://m.douban.com/movie/celebrity/[celebID]/</nowiki></code><br>
In a Wikipedia article you may insert the code below
<pre>
<pre>
{{Douban|movieID=[movieID]}} and
{{Douban|[ID]}}
{{Douban|celebID=[celebID]}}
</pre>
</pre>
'''For Movie example:'''
For example:
* <code><nowiki>{{Douban|movieID=1292052}}</nowiki></code> yields: {{Douban|movieID=1292052}}<small> (the current Wikipedia article's Tittle will be used as the link's shown text)</small><br>
* <code><nowiki>{{Douban|1292052}}</nowiki></code> yields: "{{Douban|1292052}}"<small> (the current Wikipedia article's title will be used as the link's shown text)</small>
Or you can change the Tittle by
<pre>
{{Douban|movieID=[movieID]|tittle=[movie tittle]}}
</pre>
Which will give you:
* <code><nowiki>{{Douban|movieID=1292052|tittle=[movie tittle] }}</nowiki></code> yields: {{Douban|movieID=1292052|tittle=movie tittle}}
'''For Celebrity example:'''
* <code><nowiki>{{Douban|celebID=1325127}}</nowiki></code> yields: {{Douban|celebID=1325127}}<small> (the current Wikipedia article's Tittle will be used as the link's shown text)</small><br>
Or
Or
<pre>
<pre>
{{Douban|celebID=[celebID]|tittle=[celebrity tittle]}}
{{Douban|[ID]|[Link text]}}
</pre>
</pre>
For example:
Which will give you:
* <code><nowiki>{{Douban|celebID=1325127|tittle=[celebrity tittle] }}</nowiki></code> yields: {{Douban|celebID=1325127|tittle=celebrity tittle}}
* <code><nowiki>{{Douban|1292052|EXAMPLE TEXT}}</nowiki></code> yields: "{{Douban|1292052|EXAMPLE TEXT}}"



'''2. If it is a book or a music''', then the URL should be like <code><nowiki>https://m.douban.com/book/subject/[bookID]/</nowiki></code><small>(or <code><nowiki>music</nowiki></code> in place of <code><nowiki>book</nowiki></code>)</small>. In a Wikipedia article you may insert the code below
'''2. If it is a book or a music''', then the URL should be like <code><nowiki>https://book.douban.com/subject/[ID]/</nowiki></code><small>(or <code><nowiki>music</nowiki></code> in place of <code><nowiki>book</nowiki></code>)</small>. In a Wikipedia article you may insert the code below
<pre>
<pre>
{{Douban|bookID=[bookID]|tittle=[book tittle]}},
{{Douban|[ID]|[Link text]|[Type]}},
</pre> <br>
</pre>
[Type] could be "book" or "music"<br>
Or
[Link text] could be omitted, if so, the current Wikipedia article's title will be used<br>
<pre>
For example:
{{Douban|musicID=[musicID]|tittle=[music tittle]}},
* <code><nowiki>{{Douban|1829226|EXAMPLE TEXT|book}}</nowiki></code> yields: "{{Douban|1829226|EXAMPLE TEXT|book}}"
</pre>
* <code><nowiki>{{Douban|1829226||book}}</nowiki></code> yields: "{{Douban|1829226||book}}" <small>(the current Wikipedia article's title will be used as the link's shown text)</small>
For example 1:

* <code><nowiki>{{Douban|bookID=1829226|tittle=book tittle}}</nowiki></code> yields: {{Douban|bookID=1829226|tittle=book tittle}}

For example 2:
'''3. If it is a page of other type:'''
* <code><nowiki>{{Douban|musicID=36695456|tittle=music tittle}}</nowiki></code> yields: {{Douban|musicID=36695456|tittle=music tittle}}

'''type''': Type of the Douban webpage, or the <code>[DIR]</code> in the URL <code><nowiki>https://www.douban.com/[DIR]/[id]/</nowiki></code><br>All possible values:<br>
* Movie, book or music (all of which have URL like <code><nowiki>https://[TYPE].douban.com/subject/[id]/</nowiki></code>), use 'movie', 'book' or 'music'
* Page with URL like <code><nowiki>https://www.douban.com/[DIR]/[id]/</nowiki></code>, use <code>[DIR]</code> (\"/\" is allowed)",
example: movie, game, subject, location/drama, etc.


== Parameters ==
== Parameters ==
Line 49: Line 43:
"description": "To generate a link to a Douban webpage",
"description": "To generate a link to a Douban webpage",
"params": {
"params": {
"[movieID]": {
"id": {
"label": "ID",
"label": "ID",
"description": "ID is the [movieID], take for instance: In the URL code (https://m.douban.com/movie/subject/1292052)",
"description": "ID, that is the <code>[ID]</code> in the URL <code><nowiki>https://[type/www].douban.com/[dir]/[ID]/</nowiki></code>",
"example": "movieID=1292052",
"example": "1292052",
"type": "number",
"type": "number",
"aliases": [
"aliases": [
" (is the last anonymous parameter)"
"1 (or the first anonymous parameter)"
],
],
"required": true
"required": true
},
},
"[tittle]": {
"title": {
"label": "Link Tittle or Link Text ",
"label": "Link text",
"description": "Text that is shown by the link",
"description": "Text that is shown by the link",
"example": "The Shawshank Redemption",
"example": "The Shawshank Redemption",
"type": "string",
"type": "string",
"default": "The current Wikipedia article (or page of other type)'s tittle",
"default": "The current Wikipedia article (or page of other type)'s title",
"aliases": [
"2 (or the second anonymous parameter)"
]
},
"type": {
"label": "Type",
"description": "Type of the Douban webpage (see above)",
"example": "\"movie\", \"game\", \"subject\", \"location/drama\", etc.",
"type": "string",
"default": "movie",
"aliases": [
"aliases": [
"3 (or the third anonymous parameter)"
"(can be the topic, page-tittle or your preferred tittle of the link-text or page)"
]
]
}
}
},
},
"paramOrder": [
"paramOrder": [
"[movieID]",
"id",
"[tittle]"
"title",
"type"
]
]
}
}

Revision as of 18:43, 7 April 2024

Usage

Go to Douban.com (Douban), search and find the page of the work that you are looking for, check out its URL.

1. If it is a movie, then the URL should be like https://movie.douban.com/subject/[ID]/. In a Wikipedia article you may insert the code below

{{Douban|[ID]}}

For example:

  • {{Douban|1292052}} yields: "Douban/doc at Douban (in Chinese)" (the current Wikipedia article's title will be used as the link's shown text)

Or

{{Douban|[ID]|[Link text]}}

For example:


2. If it is a book or a music, then the URL should be like https://book.douban.com/subject/[ID]/(or music in place of book). In a Wikipedia article you may insert the code below

{{Douban|[ID]|[Link text]|[Type]}},

[Type] could be "book" or "music"
[Link text] could be omitted, if so, the current Wikipedia article's title will be used
For example:

  • {{Douban|1829226|EXAMPLE TEXT|book}} yields: "EXAMPLE TEXT at Douban (in Chinese)"
  • {{Douban|1829226||book}} yields: "Douban/doc at Douban (in Chinese)" (the current Wikipedia article's title will be used as the link's shown text)


3. If it is a page of other type:

type: Type of the Douban webpage, or the [DIR] in the URL https://www.douban.com/[DIR]/[id]/
All possible values:

  • Movie, book or music (all of which have URL like https://[TYPE].douban.com/subject/[id]/), use 'movie', 'book' or 'music'
  • Page with URL like https://www.douban.com/[DIR]/[id]/, use [DIR] (\"/\" is allowed)",

example: movie, game, subject, location/drama, etc.

Parameters

To generate a link to a Douban webpage

Template parameters

ParameterDescriptionTypeStatus
IDid 1 (or the first anonymous parameter)

ID, that is the <code>[ID]</code> in the URL <code><nowiki>https://[type/www].douban.com/[dir]/[ID]/</nowiki></code>

Example
1292052
Numberrequired
Link texttitle 2 (or the second anonymous parameter)

Text that is shown by the link

Default
The current Wikipedia article (or page of other type)'s title
Example
The Shawshank Redemption
Stringoptional
Typetype 3 (or the third anonymous parameter)

Type of the Douban webpage (see above)

Default
movie
Example
"movie", "game", "subject", "location/drama", etc.
Stringoptional