Numbers and Strings in free and PRO plugin

Numbers and Strings:
See this JSON:

{"num": 3.5050, "str": "3.4040" }

There is a little difference: “num” is without quotation marks, “str” is with.
The JSON Content Importer Plugin and the PHP behind that handles the “num” as numeric data and removes the 0 at the end.

Free JCI:

[jsoncontentimporter url=http://api.json-content-importer.com/extra/json/number.json]num: {num}, str: {str}[/jsoncontentimporter]

Free JCI in Action:
Note the missing 0 for the value of “num”

num: 3.505, str: 3.4040

PRO JCI:

To “save” the 0 you need the PRO plugin – unfortunately: There “convertjsonnumbers2strings=yes” converts the JSON to do this.

JCI-Shortcode:

[jsoncontentimporterpro nameoftemplate="twig-numbers" convertjsonnumbers2strings=yes]

JCI-Template:

  • URL: see above
  • twig-template:
{{num}} {{str}}

PRO in action:

3.5050 3.4040

PRO & free: API daten.buergernetz.bz.it

Challenge: Display data from the API http://daten.buergernetz.bz.it/services/weather/bulletin?format=json&lang=de

local stored JSON: http://api.json-content-importer.com/extra/json/daten.buergernetz.bz.it.json

Free Plugin:

[jsoncontentimporter url=http://daten.buergernetz.bz.it/services/weather/bulletin?format=json&lang=de]
{date}<br> 
{subloop:today:-1}<br> {today.title}<br> {subloop-array:today.stationData:-1}<br> {subloop:today.stationData.symbol:-1} <br> {today.stationData.symbol.description}: {today.stationData.min}-{today.stationData.max}<br> {/subloop:today.stationData.symbol} <br> {/subloop-array:today.stationData} <br> {/subloop:today} <br> 
[/jsoncontentimporter]

PRO JCI-Plugin:

  • twig-template:
{{today.date | date('d.m.Y, H:i:')}}: {{today.conditions}}<br>
{{today.temperatures}}<br>
{% for s in today.stationData %}
Station {{loop.index}}, code: {{s.symbol.code}}: {{s.min}}-{{s.max}} <img src="{{s.symbol.imageUrl}}"><hr>
{% endfor %}
<hr>Pick the 3rd station in the list:
 code: {{today.stationData.3.symbol.code}}: {{today.stationData.3.min}}-{{today.stationData.3.max}}  

PRO JCI Plugin in action:

05.02.2022, 00:00:: Anfangs streift eine schwache Kaltfront die Alpennordseite, im Tagesverlauf wird die Luft wieder trockener.
Die Höchstwerte liegen zwischen 3° bis 13°.
Station 1, code: a: -2-9
Station 2, code: a: -1-13
Station 3, code: a: -2-11
Station 4, code: b: -4-6
Station 5, code: a: -3-8
Station 6, code: b: -7-4

Pick the 3rd station in the list: code: b: -4-6

Free: Show Data with subloop-array

Challenge:

Show data from http://api.json-content-importer.com/extra/json/PareStranoit.json


Shortcode:


[jsoncontentimporter url=http://api.json-content-importer.com/extra/json/PareStranoit.json]
totalResults: {totalResults}
{subloop-array:entry:-1}
entry.championship_name: {entry.championship_name}
{subloop-array:entry.standing:-1}entry.standing.team_name: {entry.standing.team_name}{/subloop-array:entry.standing}
{/subloop-array:entry}
[/jsoncontentimporter]

In Action:


totalResults: 2

entry.championship_name: Regular Season Serie A2 Credem Banca – Girone Bianco
entry.standing.team_name: Synergy Arapi F.lli Mondovì
entry.standing.team_name: Monini Spoleto


Free: API www.veterans.gc.ca

1917-08-08 00:00:00.0: 19860, James Cotter
1918-08-08 00:00:00.0: 25949, William Jennings
1918-08-08 00:00:00.0: 25972, William John King

Gutenberg-Block using these settings:

{subloop-array:days:3}
{DATE_OF_DEATH}: {CASUALTY}, {FORENAMES} {SURNAME}<br>
{/subloop-array:days}

JCI-Template:

[jsoncontentimporter url=https://www.veterans.gc.ca/xml/jsonp/app.cfc?method=remoteGetHonourRoll&amp;language=en]{subloop-array:days:-1}
{DATE_OF_DEATH}: {CASUALTY}, {FORENAMES} {SURNAME}<br>
{/subloop-array:days}[/jsoncontentimporter]

Free: Basic JCI-Gutenberg-Block usage

Task, Show some weathedata on a page with the JCI-Gutenberg-Block

Load Gutenberg-Block “JSON Content Importer FREE” e .g. by searching the Blocks by “json”:

stationID: {stationID}}<br>
neighborhood: {neighborhood}
{subloop:metric:-1}
Station: {metric.stationID}<br>
Ort: {metric.neighborhood}<br>
Luftfeuchtigkeit: {metric.humidity} %<br>
Temperatur: {metric.temp} °C<br>
Taupunkt: {metric.dewpt} °C<br>
Wind: {metric.windspeed} km/h<br>
Windboen: {metric.windgust}km/h<br>
Luftdruck: {metric.pressure} hpa<br>
Niederschlag: {metric.precipRate} mm<br>
{/subloop:metric}

In Action:

stationID: IARGEN42}
neighborhood: EisenharzStation:
Ort:
Luftfeuchtigkeit: %
Temperatur: 22 °C
Taupunkt: 13 °C
Wind: 0 km/h
Windboen: 0km/h
Luftdruck: 1013.88 hpa
Niederschlag: 0 mm

Free Plugin: api.wordpress.org/events with Gutenberg-Block

With http://api.wordpress.org/events/1.0/?latitude=47.496&longitude=8.226 you can display the next WordPress-Events arround a geoposition. This can be displayed with the free plugin this way:

Create a new page with Gutenberg active. Insert the above URL into the Blocks API-URL. The “basenode” is “events”.
The template is:

<a href={url} target=_blank>{title}</a><br>{date}
<br>{subloop:location:-1}
<a href=https://www.google.com/maps?q={location.latitude}+{location.longitude}targt=_blank>{location.location}</a><hr>
{/subloop:location}

 

Screenshot of the Block-Settings:

Example in Action: Additional set “Number of json-top-level-items to display” to 2.

If you want to format the date you need the pro plugin.

In Action via Gutenberg-Block:

Free: Apple / Itunes-API

Apple / Itunes-API, see https://rss.applemarketingtools.com/

Example: https://rss.applemarketingtools.com/api/v2/us/music/most-played/10/albums.json

Local stored JSON:
http://api.json-content-importer.com/extra/json/apple/apple-example.json


Shortcode:

[jsoncontentimporter url=http://api.json-content-importer.com/extra/json/apple/apple-example.json basenode=feed.results]
<img src="{artworkUrl100}"><b>{artistName}</b><br>{name}<br>
Genres: {subloop-array:genres:-1}{genres.name} {/subloop-array:genres}
<a href="{url}" target="_blank">more</a>
<hr>
[/jsoncontentimporter]

In Action:


Lin-Manuel Miranda, Germaine Franco, Stephanie Beatriz, Olga Merediz & Jessica Darrow
Encanto (Original Motion Picture Soundtrack)
Genres: Music Soundtrack
more



Gunna
DRIP SEASON 4EVER
Genres: Hip-Hop/Rap Music
more



YoungBoy Never Broke Again
Colors
Genres: Hip-Hop/Rap Music
more



The Weeknd
Dawn FM
Genres: R&B/Soul Music
more



Babyface Ray
FACE
Genres: Hip-Hop/Rap Music
more



NLE Choppa
Me vs. Me
Genres: Hip-Hop/Rap Music
more



Drake
Certified Lover Boy
Genres: Hip-Hop/Rap Music
more



Summer Walker
Still Over It
Genres: R&B/Soul Music
more



Juice WRLD
Fighting Demons (Lyric Video Version)
Genres: Hip-Hop/Rap Music
more



Adele
30
Genres: Pop Music
more


Free & PRO for bitvalor.com API

Task: Display data from https://api.bitvalor.com/v1/ticker.json

Local stored JSON: http://api.json-content-importer.com/extra/json/bitvalorticker.json

Free JCI-Plugin Shortcode:

[jsoncontentimporter url=https://api.bitvalor.com/v1/ticker.json basenode=ticker_24h] 
total.last: {subloop:total:-1}{total.last}{/subloop:total}
[/jsoncontentimporter]

twig-template:

total.last: {{ticker_24h.total.last}}<br>
{% for key, val in ticker_24h.exchanges %} 
{{key}}: {{val.high}}<br>
{% endfor %} <br>
Mercado Bitcoin = R$ {{ticker_1h.exchanges.MBT.last}}

Shortcode (convertjsonnumbers2strings=yes needed here, as numbers are extra-long):

[jsoncontentimporterpro nameoftemplate="bitvalor" convertjsonnumbers2strings=yes]

PRO in Action:

total.last: 205343.02338294176
MBT: 208000
BSQ: 211282.882

Mercado Bitcoin = R$ 205333.33

PRO & Free: API api.coindesk.com

Task: Display data from https://api.coindesk.com/v1/bpi/currentprice.json

Local stored JSON: http://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

Free: API Wikipedia.org

API-Source:
Wikipedia API is at https://www.mediawiki.org/wiki/API:Main_page

API-Example:
https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&formatversion=2&titles=munich

see Wikipedia: https://en.wikipedia.org/wiki/Munich

Local stored JSON: http://api.json-content-importer.com/extra/json/wikipedia-munich-api-result.json


JCI-Syntax for free Plugin:

[jsoncontentimporter url=https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&formatversion=2&titles=munich basenode=query]
{subloop-array:pages:-1} {pages.title}<br>{pages.extract} {/subloop-array:pages} 
[/jsoncontentimporter]

In Action:


Munich
Munich ( MEW-nik; German: München [ˈmʏnçn̩] (listen); Bavarian: Minga [ˈmɪŋ(ː)ɐ] (listen)) is the capital and most populous city of Bavaria. With a population of 1,558,395 inhabitants as of 31 July 2020, it is the third-largest city in Germany, after Berlin and Hamburg, and thus the largest which does not constitute its own state, as well as the 11th-largest city in the European Union. The city's metropolitan region is home to 6 million people.Straddling the banks of the River Isar (a tributary of the Danube) north of the Bavarian Alps, it is the seat of the Bavarian administrative region of Upper Bavaria, while being the most densely populated municipality in Germany (4,500 people per km2). Munich is the second-largest city in the Bavarian dialect area, after the Austrian capital of Vienna. The city was first mentioned in 1158. Catholic Munich strongly resisted the Reformation and was a political point of divergence during the resulting Thirty Years' War, but remained physically untouched despite an occupation by the Protestant Swedes. Once Bavaria was established as a sovereign kingdom in 1806, Munich became a major European centre of arts, architecture, culture and science. In 1918, during the German Revolution, the ruling house of Wittelsbach, which had governed Bavaria since 1180, was forced to abdicate in Munich and a short-lived socialist republic was declared. In the 1920s, Munich became home to several political factions, among them the NSDAP. After the Nazis' rise to power, Munich was declared their "Capital of the Movement". The city was heavily bombed during World War II, but has restored most of its traditional cityscape. After the end of postwar American occupation in 1949, there was a great increase in population and economic power during the years of Wirtschaftswunder, or "economic miracle". The city hosted the 1972 Summer Olympics and was one of the host cities of the 1974 and 2006 FIFA World Cups. Today, Munich is a global centre of art, science, technology, finance, publishing, culture, innovation, education, business, and tourism and enjoys a very high standard and quality of living, reaching first in Germany and third worldwide according to the 2018 Mercer survey, and being rated the world's most liveable city by the Monocle's Quality of Life Survey 2018. According to the Globalization and World Rankings Research Institute, Munich is considered an alpha-world city, as of 2015. It is one of the most prosperous and fastest growing cities in Germany. Munich's economy is based on high tech, automobiles, the service sector and creative industries, as well as IT, biotechnology, engineering and electronics among many others. The city houses many multinational companies, such as BMW, Siemens, MAN, Allianz and MunichRE. It is also home to two research universities, a multitude of scientific institutions, and world class technology and science museums like the Deutsches Museum and BMW Museum. Munich's numerous architectural and cultural attractions, sports events, exhibitions and its annual Oktoberfest attract considerable tourism. The city is home to more than 530,000 people of foreign background, making up 37.7% of its population.