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 jsoncontentimporter:
[jsoncontentimporter url=http://api.json-content-importer.com/extra/json/number.json]num: {num}, str:  {str}[/jsoncontentimporter]

gives us this:
num: 3.505, str: 3.4040
To “save” the 0 you need the PRO plugin – unfortunately: There “convertjsonnumbers2strings=yes” converts the JSON to do this.
[jsoncontentimporterpro url=http://api.json-content-importer.com/extra/json/number.json convertjsonnumbers2strings=yes  parser=twig]
{{num}} {{str}}[/jsoncontentimporterpro]

gives us this:
num:3.5050, str:3.4040

Free JCI Plugin: Data from playlist with basenode and without

JSON: https://cast02.siamsa.ie/public/radio_siamsa/api/live/nowplaying/radio_siamsa
Solution:
[jsoncontentimporter url=https://cast02.siamsa.ie/public/radio_siamsa/api/live/nowplaying/radio_siamsa basenode=now_playing.song] {text}<img src={art}> [/jsoncontentimporter]
or:
[jsoncontentimporter url=https://cast02.siamsa.ie/public/radio_siamsa/api/live/nowplaying/radio_siamsa] {subloop:now_playing:-1} {subloop:now_playing.song:-1} {now_playing.song.text}<img src={now_playing.song.art}> {/subloop:now_playing.song} {/subloop:now_playing} [/jsoncontentimporter]

Books: Current Bestseller

With the free JSON Content Importer Plugin you can display the New York Times Bestseller-Booklist:

Code for that:
[jsoncontentimporter url=https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=YOUR_NYT_API_BOOK_KEY basenode=results] {list_name}<br>{subloop-array:books:-1}<img src="{books.book_image}" title="{books.title}" align="left" width="40" hspace="5"> {books.rank}. <a href="{books.amazon_product_url}" target="_blank">{books.title}</a><br>{books.description}<br clear="all"> <hr>{/subloop-array:books} [/jsoncontentimporter]


In action:

Hardcover Fiction
1. STATE OF TERROR
In the wake of the previous administration’s mishandling of international affairs, the new Secretary of State Ellen Adams confronts interconnected global threats.


2. THE WISH
Maggie Dawes, a renowned travel photographer, struggles with a medical diagnosis over Christmas.

3. THE LINCOLN HIGHWAY
Two friends who escaped from a juvenile work farm take Emmett Watson on an unexpected journey to New York City in 1954.

4. CLOUD CUCKOO LAND
An interconnected cast of dreamers and outsiders are in dangerous and disparate settings past, present and future.

5. APPLES NEVER FALL
The Delaney siblings suspect their father of causing the disappearance of their mother.

6. SILVERVIEW
A London spy chief’s investigation brings him to a quiet seaside town where Julian Lawndsley has relocated and opened a bookstore.

7. THE LAST THING HE TOLD ME
Hannah Hall discovers truths about her missing husband and bonds with his daughter from a previous relationship.

8. THE BOOK OF MAGIC
The fourth book in the Practical Magic series. Three generations of Owens women try to save a young man’s life.

9. HARLEM SHUFFLE
Ray Carney, a family man who sells furniture on 125th Street, gets a new clientele made up of vicious and unsavory characters.

10. THE BUTLER
The working relationship between a man and woman from different worlds develops into something new for them.

11. BILLY SUMMERS
A killer for hire who only takes out bad guys seeks redemption as he does one final job.

12. CROSSROADS
Members of a Midwestern family find themselves at a pivotal moment of moral crisis in 1971.

13. THE MIDNIGHT LIBRARY
Nora Seed finds a library beyond the edge of the universe that contains books with multiple possibilities of the lives one could have lived.

14. BEAUTIFUL WORLD, WHERE ARE YOU
A novelist, a warehouse worker, an editorial assistant and a political adviser deal with changes.

15. THE JAILHOUSE LAWYER
A young lawyer winds up in an Alabama jail that remains mysteriously crowded.

JCI and casino.chompcasino.com

Challenge: Load https://casino.chompcasino.com/content/chomp-casino/json/2.1/manifest_multicurrency.json and display those game-items containing a defined title.

Solution: Create a new JCI-template with the following settings.
URL: https://casino.chompcasino.com/content/chomp-casino/json/2.1/manifest_multicurrency.json
urlparam4twig : t

Twig code in template:

{% set t = 'Mont' %}
{% if urlparam.t %}
{% set t = urlparam.t %}
{% endif %}
term: {{t}}<br>
{% for g in games if g.title matches '/'~t~'/i'  %}
title: {{g.title}}<br>
{% for i in g.images %}
{{i.url}}
{% endfor %}
<hr>
{% endfor %}

Create new page with this Shortcode: [jsoncontentimporterpro id=NUMBER_OF_JCI_TEMPLATE]

In Action:

Try also this: http://api.json-content-importer.com/jci-and-casino-chompcasino-com/?t=romance

term:Mont
title:Montezuma
/content/all/images/montezuma/banner.jpg/content/all/images/montezuma/tile.jpg

JCI and TablePress

The Plugin “TablePress” and the PRO version of the JSON Content Importer can work together in this way:

  1. Create a new TablePress-Table with e. g. two columns and two rows. Fill the cells with some dummy text. This gives you a shortcode [table id=NUMBER_OF_TABLEPRESS_TABLE].

  2. Create a new JCI-Plugin Template with e. g. some JSON data. The Twig-Code is

    name: {{_context.0.name}}
    [table id=NUMBER_OF_TABLEPRESS_TABLE /]
    
  3. Create a new WordPress-Page/Post with this shortcode:
    [jsoncontentimporterpro nameoftemplate=NAME_OF_JCI_TEMPLATE orderofshortcodeeval=2]
    

    Preview this page: You should see some “name”-Data and a Table.

  4. Then change the content of a Table-Cell and insert {{_context.0.name}} there.

  5. Preview again and you should see the JSON-data in the Table.

If the number of columns or rows is dynamic: Up to my knowledge TablePress has a fixed number of cols and rows. So this is not that flexible.
Maybe Table Sort is an option then.

JCI and Table Press in Action:

name:Love Breakfast
1a:Love Breakfast1b
2a2b