• Resolved testaccount165

    (@testaccount165)


    Hi everyone,

    I’ve got two questions:
    1. Is there a way to add today’s date in the url as a value like this: date=2017-12-05?
    2. Can someone help me with the code to extract the data from “data” in this JSON format:

    {
    “chartData”: {
    “prev”: “2017-12-04”,
    “next”: null,
    “date”: “2017-12-05”,
    “type”: “day”,
    “data”: [
    [1512468000000, 33.359999999999999],
    [1512468300000, 81.189999999999998],
    [1512468600000, 93.310000000000002],
    [1512468900000, 104.15000000000001],
    [1512469200000, 86.810000000000002]
    ]
    }
    }

Viewing 1 replies (of 1 total)
  • Plugin Author berkux

    (@berkux)

    Try:
    [jsoncontentimporter url=… basenode=chartData]
    prev: {prev}
    [/jsoncontentimporter]

    The “data” can’t be fetched by the free version.
    The pro-version is doing this ( see https://wptest.kux.de/8172-2/ )

    [jsoncontentimporterpro url=https://wptest.kux.de/extra/json/t165.json parser=twig]prev: {{chartData.prev}}
    {% for key in chartData.data %}
    {{chartData.data[loop.index0][0]}} – {{chartData.data[loop.index0][1]}}
    {% endfor %}
    [/jsoncontentimporterpro]

    There PHP rounds the numbers… Even the pro version can’t change that…

Viewing 1 replies (of 1 total)
  • The topic ‘Help with JSON’ is closed to new replies.