This is a project to get any kind of json data for any advent-calendar website or something else.
You can put your data in a json array and then, depending on the day, you get the entries of the array until this day
This project is designed to be configured for different data storages in the future, for example mysql, instead of json files
- put all these files in a web-directory
- the
index.php
file is the main entrypoint, so point every single request to this file! - For jsonFile usage:
- in the
storage
folder put a file namedadvent.json
(will be auto-generated on the first request, if it didn't exist) - the json file has the following structure (you can configure objects, strings, etc.):
- in the
{
"data": [
{"key": 123},
{"key2": "value2"},
{"key3": {"object": 1, "test": 2}},
{"key4": "value4", "key5": "value5"}
]
}
- Make a request and you get the following result:
Example for days before december (like november, so your calendar can get live without any dors opend)
{
"data": []
}
December, 1st:
{
"data": [
{"key": "value"}
]
}
December, 29th (if you have configured enough data in you config):
{
"data": [
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"},
{"key": "value"}
]
}
- add an
overwriteDay
key-value pair to the root element of the json
{
"overwriteDay": 24,
"data": [] //data from above
}
Questions? Open an issue
© Trickfilm400 2021-2022