I did that,
Now it’s solved, I copied the .json in the right folder
I did that,
Now it’s solved, I copied the .json in the right folder
some errors with nom install
pi@raspberrypi:~/MagicMirror/modules/default/MMM-HTTPRequestDisplay $ npm install
npm WARN enoent ENOENT: no such file or directory, open ‘/home/pi/MagicMirror/modules/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/home/pi/MagicMirror/modules/node_modules/node_helper/package.json’
npm WARN modules No description
npm WARN modules No repository field.
npm WARN modules No README data
npm WARN modules No license field.
I will test it today.
Simple of the xml file
<response>
<led0>0</led0>
<led1>0</led1>
<led2>0</led2>
<led3>0</led3>
<led4>1</led4>
<led5>0</led5>
<led6>0</led6>
<led7>0</led7>
<led8>0</led8>
<led9>0</led9>
<led10>0</led10>
<led11>0</led11>
<led12>0</led12>
<led13>0</led13>
<led14>0</led14>
<led15>0</led15>
<led16>0</led16>
<led17>0</led17>
<led18>0</led18>
<led19>0</led19>
<led20>0</led20>
<led21>0</led21>
<led22>0</led22>
<led23>0</led23>
<led24>0</led24>
<led25>0</led25>
<led26>0</led26>
<led27>0</led27>
<led28>0</led28>
<led29>0</led29>
<led30>0</led30>
<led31>0</led31>
<btn0>up</btn0>
<btn1>up</btn1>
<btn2>up</btn2>
<btn3>up</btn3>
<btn4>up</btn4>
<btn5>up</btn5>
<btn6>up</btn6>
<btn7>up</btn7>
<btn8>up</btn8>
<btn9>up</btn9>
<btn10>up</btn10>
<btn11>up</btn11>
<btn12>up</btn12>
<btn13>up</btn13>
<btn14>up</btn14>
<btn15>up</btn15>
<btn16>up</btn16>
<btn17>up</btn17>
<btn18>up</btn18>
<btn19>up</btn19>
<btn20>up</btn20>
<btn21>up</btn21>
<btn22>up</btn22>
<btn23>up</btn23>
<btn24>up</btn24>
<btn25>up</btn25>
<btn26>up</btn26>
<btn27>up</btn27>
<btn28>up</btn28>
<btn29>up</btn29>
<btn30>up</btn30>
<btn31>up</btn31>
<day>24/06/2016</day>
<time0>08:55:17</time0>
<analog0>22</analog0>
<analog1>746</analog1>
<analog2>749</analog2>
<analog3>215</analog3>
<analog4>0</analog4>
<analog5>0</analog5>
<analog6>0</analog6>
<analog7>0</analog7>
<analog8>0</analog8>
<analog9>0</analog9>
<analog10>0</analog10>
<analog11>0</analog11>
<analog12>0</analog12>
<analog13>0</analog13>
<analog14>0</analog14>
<analog15>0</analog15>
<count0>22</count0>
<count1>0</count1>
<count2>0</count2>
<count3>0</count3>
<count4>0</count4>
<count5>0</count5>
<count6>0</count6>
<count7>0</count7>
<tinfo>---</tinfo>
<version>3.05.38_vsr</version>
</response>
wow super,
I’m trying to run the code but “ReferenceError: document is not defined”
@Eunanibus Based on a xml file containing data from temperature captors, via the code above in php I visualise some data in a html table.
I need convert the php code to js code, i think
In php I’m using this code
$xml = simplexml_load_file('http://ip:8889/status.xml');
$result = array();
foreach($xml->children() as $child){
$result[$child->getName()] = trim($child);
}