As @DrAzzy says, the most simple, hacky way to send data is (for example to send temperature):
require("http").get("http://www.mysite.com?temp="+E.getTemperature(), function(res) { var contents = ""; res.on('data', function(data) { contents += data; }); res.on('close', function() { console.log("Done! Got "+contents); }); });
Ideally you would use HTTP POST to stop accidental puts of data by web crawlers, in which case you could do:
function sendData() { var options = { host: 'mysite.com', port: '80', path:"pageName?temp="+E.getTemperature(), method:'POST' }; require("http").request(options, function(res) { var d = ""; res.on('data', function(data) { d+=data; }); res.on('close', function(data) { console.log("Done! Got "+d); }); }).end(); }
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
As @DrAzzy says, the most simple, hacky way to send data is (for example to send temperature):
Ideally you would use HTTP POST to stop accidental puts of data by web crawlers, in which case you could do: