Template:YouTube data display: Difference between revisions

From LudoWiki
No edit summary
No edit summary
Line 4: Line 4:
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>{{#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%}}
<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: {{#time: H:i:s|00:00:00 + {{#replace:{{#replace:{{#replace:{{#sub:{{#external_value:duration}}|2}}|M| minutes }}|H| hours }}|S| seconds }} }}]]</span></span>
<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: {{#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 + |:}} }} }}
{{#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 + |:}} }} }}

Revision as of 18:23, 6 February 2023

This is the "YouTubeDataDisplay" template.

Edit the page to see the template text.