Php webtags: Difference between revisions

m
 
== Option 3: JavaScript Object Notation ==
This is a lightweight data-interchange format (JSON) that is easy for humans to read and write, but critically it is easy for machines to parse and generate for transferring the variables in a portable way.
 
Cumulus MX uses this approach to provide variables for plotting the charts on your web site (Trends web page).
*To have the json files uploaded to your web site, you must enable '''Include standard files''' within the ''Web/FTP settings'' section of '''Internet Settings'''.
*Cumulus MX has one json file per weather chart
* Within each json file there is an array defined; each element of that array being a sub-array containing a time-stamp and the value at that time.
*For the main temperature chart, the JSON file contains such time & value pairs for outside temperature, inside temperature, and derivatives (wind chill, apparent temperature, heat index, feels like).
*The interval between sub-arrays (time and value pairs) depends on the chart, for daily rain and daily temperature there is a sub array for each day; but for most there is a sub-array for every minute (assuming Cumulus is left running for long enough) for a full 24 hours.
 
If you want to set up your own json files, you may follow the same approach but need to choose the interval between such sub-arrays that suits your use in your web pages.
 
 
= Using PHP script =
5,838

edits