Template:YouTube data display: Difference between revisions

From LudoWiki
No edit summary
No edit summary
 
(47 intermediate revisions by the same user not shown)
Line 3: Line 3:


Edit the page to see the template text.
Edit the page to see the template text.
</noinclude><includeonly>{{#get_web_data:url=https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&id={{{YouTube video ID|}}}&key=AIzaSyC-zQp-SoOYbKh64GrNhBK5D3g7H9oX7Zs|format=json}}{{DISPLAYTITLE:{{#external_value:title}}}}
</noinclude><includeonly><span itemscope itemref="item1" itemtype="https://schema.org/VideoGameClip">{{#get_web_data:url=https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&id={{{YouTube video ID|}}}&key=AIzaSyC-zQp-SoOYbKh64GrNhBK5D3g7H9oX7Zs|format=json}}
{| class="ludotable" style="margin: auto; font-size: medium;"
<span itemprop="associatedMedia" itemtype="https://schema.org/associatedMedia">
!colspan="3"| {{#widget:YouTube|id={{{YouTube video ID|}}}|width=480|height=295}}
<span itemprop="video" itemtype="https://schema.org/VideoObject" itemscope>{{#widget:YouTube|id={{{YouTube video ID|}}}|width=100%}}
|-
<!-- mandatory properties for google rich snippets -->
| [[Video title::{{{Video title|}}}]] [[YouTube video ID::{{{YouTube video ID|}}}]]
<meta itemprop="name" content="{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{YouTube video ID}}}]] |link=none |default={{#external_value:title}} }}"/>
|-
<meta itemprop="description" content="{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{YouTube video ID}}}]] |link=none |default={{#external_value:title}} }} on YouTube." />
| &#x1F441; Views: [[Views::{{#external_value:viewcount}}]]
<meta itemprop="thumbnailUrl" content="https://i.ytimg.com/vi/{{{YouTube video ID|}}}/maxresdefault.jpg" />
| &#x2764; Likes: {{#external_value:likecount}}
<meta itemprop="uploadDate" content="{{#external_value:publishedat}}" />
| &#x1F5E9; Comments: {{#external_value:commentcount}}
<meta itemprop="embedUrl" content="https://www.youtube.com/embed/{{{YouTube video ID|}}}?controls=2&modestbranding=1&rel=0" />
|-
</span>
!colspan="3"|
</span>
|-
<span class="ludohori" style="width:100%">
| &#x1F4C5; Date: {{#time:d F Y|{{#external_value:publishedat}}}}
<span>&#x1F441; Views: [[Views::{{#external_value:viewcount}}]]</span>
| &#x23F1; Duration: {{#replace:{{#replace:{{#sub:{{#external_value:duration}}|2|-1}}|M|:}}|H|:}}
<span>&#x2764; Likes: [[Likes::{{#external_value:likecount}}]]</span>
|  
<span>&#x1F5E9; Comments: <span itemprop="commentCount">[[Comments::{{#external_value:commentcount}}]]</span></span>
|}{{#formlink:form=YouTube video page|link text=Edit data with form|link type=|target={{PAGENAME}}}}
<span>&#x1F4C5; Date: {{#time:d F Y|{{#external_value:publishedat}}}}</span>
__NOEDITSECTION__
<span>&#x23F1; Duration: {{#time: H:i:s|00:00:00 + {{#replace:{{#replace:{{#replace:{{#sub:{{#external_value:duration}}|2}}|M| minutes }}|H| hours }}|S| seconds }} }}</span>
</includeonly>
</span>
{{#set: Video title={{{Video title|{{#external_value:title}} }}} | YouTube video ID={{{YouTube video ID|}}} | Duration={{#expr: {{#replace:{{#replace:{{#sub:{{#external_value:duration}}|2|-1}}|M| * 60 + }}| * 3600 + |:}} }} }}</span> [[Category:YouTube videos]] __NOEDITSECTION__ {{#default_form:YouTube video page}}</includeonly>

Latest revision as of 19:14, 12 February 2023

This is the "YouTubeDataDisplay" template.

Edit the page to see the template text.