Template:WikipediaExtract: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
|use stale cache | |use stale cache | ||
}} | }} | ||
{{#get_web_data: | |||
url=https://en.wikipedia.org/w/api.php?format=json&action=query&prop=pageimages&pilimit=1&pilicense=any&pithumbsize=300&titles={{trim| {{{1}}} }} | |||
|format=JSON | |||
|use jsonpath | |||
|data=image=$.query.pages.*.thumbnail.source | |||
|cache seconds=3600 | |||
|use stale cache | |||
}} | |||
{{#ifeq:{{#len:{{#external_value:image}}}}|0||<table class="wikitable" style="float:right; margin:0; margin-left: 10px;"><tr><td>{{#external_value:image}}</td></tr></table>}} | |||
{{#external_value:extract}} | {{#external_value:extract}} | ||
* https://en.wikipedia.org/wiki/{{{1}}} | * https://en.wikipedia.org/wiki/{{trim| {{{1}}} }} |