Task: Display data from https://api.coindesk.com/v1/bpi/currentprice.json
Local stored JSON: https://api.json-content-importer.com/extra/json/coindesk.json
Free version:
[[jsoncontentimporter url=https://api.coindesk.com/v1/bpi/currentprice.json] {subloop:time:-1}{time.updated}{/subloop:time}- {subloop:bpi:-1} {subloop:bpi.USD:-1}{bpi.USD.symbol}{bpi.USD.rate}: {bpi.USD.description} {/subloop:bpi.USD} {/subloop:bpi} [/jsoncontentimporter]]
Free in action:
Feb 6, 2022 22:58:00 UTC-
$41,618.6448: United States Dollar
Pro-Version (date-formatting, shorter code, use of template-manager: much better…):
twig-template:
{{time.updated | date("d.m.Y, H:i:s")}}: {{bpi.USD.symbol}}{{bpi.USD.rate}}: {{bpi.USD.description}}
Shortcode:
[[jsoncontentimporterpro nameoftemplate="api.coindesk.com"]]
PRO in action:
06.02.2022, 22:58:00: $41,618.6448: United States Dollar