Template:YouTube data display: Difference between revisions

From LudoWiki
No edit summary
No edit summary
 
(28 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}}{{#widget:YouTube|id={{{YouTube video ID|}}}|width=100%}}
</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}}
<span class="ludohori"><span>&#x1F441; Views: [[Views::{{#external_value:viewcount}}]]</span><span>&#x2764; Likes: {{#external_value:likecount}}</span><span>&#x1F5E9; Comments: {{#external_value:commentcount}}</span><span>&#x1F4C5; Date: {{#time:d F Y|{{#external_value:publishedat}}}}</span><span>&#x23F1; Duration: {{#replace:{{#replace:{{#sub:{{#external_value:duration}}|2|-1}}|M|:}}|H|:}}</span></span>
<span itemprop="associatedMedia" itemtype="https://schema.org/associatedMedia">
 
<span itemprop="video" itemtype="https://schema.org/VideoObject" itemscope>{{#widget:YouTube|id={{{YouTube video ID|}}}|width=100%}}
{{#time: H:i:s|{{#replace:{{#replace:{{#sub:{{#external_value:duration}}|2|-1}}|M|:}}|H|:}}}}
<!-- mandatory properties for google rich snippets -->
 
<meta itemprop="name" content="{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{YouTube video ID}}}]] |link=none |default={{#external_value:title}} }}"/>
{{#set: Video title={{{Video title|{{#external_value:title}} }}} | YouTube video ID={{{YouTube video ID|}}} }}
<meta itemprop="description" content="{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{YouTube video ID}}}]] |link=none |default={{#external_value:title}} }} on YouTube." />
 
<meta itemprop="thumbnailUrl" content="https://i.ytimg.com/vi/{{{YouTube video ID|}}}/maxresdefault.jpg" />
{{#formlink:form=YouTube video page|link text=Edit data with form|link type=|target={{PAGENAME}}}}
<meta itemprop="uploadDate" content="{{#external_value:publishedat}}" />
__NOEDITSECTION__
<meta itemprop="embedUrl" content="https://www.youtube.com/embed/{{{YouTube video ID|}}}?controls=2&modestbranding=1&rel=0" />
</includeonly>
</span>
</span>
<span class="ludohori" style="width:100%">
<span>&#x1F441; Views: [[Views::{{#external_value:viewcount}}]]</span>
<span>&#x2764; Likes: [[Likes::{{#external_value:likecount}}]]</span>
<span>&#x1F5E9; Comments: <span itemprop="commentCount">[[Comments::{{#external_value:commentcount}}]]</span></span>
<span>&#x1F4C5; Date: {{#time:d F Y|{{#external_value:publishedat}}}}</span>
<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>
</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.