Template:YouTube data display: Difference between revisions
No edit summary |
No edit summary |
||
| (22 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>👁 Views: [[Views::{{#external_value:viewcount}}]]</span><span>❤ Likes: {{#external_value:likecount}}</span><span>🗩 Comments: {{#external_value:commentcount}}</span><span>📅 Date: {{#time:d F Y|{{#external_value:publishedat}}}}</span><span>⏱ Duration: {{#time: H:i:s|00:00:00 + {{#replace:{{#replace:{{#replace:{{#sub:{{#external_value:duration}}|2}}|M| minutes }}|H| hours }}|S| seconds }} }}</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%}} | |||
{{#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 + |:}} }} }} | <!-- 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}} }}"/> | |||
{{# | <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" /> | |||
</includeonly> | <meta itemprop="uploadDate" content="{{#external_value:publishedat}}" /> | ||
<meta itemprop="embedUrl" content="https://www.youtube.com/embed/{{{YouTube video ID|}}}?controls=2&modestbranding=1&rel=0" /> | |||
</span> | |||
</span> | |||
<span class="ludohori" style="width:100%"> | |||
<span>👁 Views: [[Views::{{#external_value:viewcount}}]]</span> | |||
<span>❤ Likes: [[Likes::{{#external_value:likecount}}]]</span> | |||
<span>🗩 Comments: <span itemprop="commentCount">[[Comments::{{#external_value:commentcount}}]]</span></span> | |||
<span>📅 Date: {{#time:d F Y|{{#external_value:publishedat}}}}</span> | |||
<span>⏱ 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.