so I currently have a JavaScript code that I run on my iPhone to pull its Accelerometer data. What I would like to do is Pass this data to my Mac Book Pro and use the variables in A python Script. The Variables are changing multiple times a second so it would need to repeatedly send the Variables. I would greatly appreciate any help I can get. Thank you.
<html>
<body>
<div id="content">
<h1>Accelerometer JavaScript Test</h1>
<ul>
<li>acceleration x: <span id="accelerationX"></span></li>
<li>acceleration y: <span id="accelerationY"></span></li>
<li>Motor Speed: <span id="speed"></span></li>
</ul>
</div>
<script type="text/javascript">
window.ondevicemotion = function(e){
var x = e.accelerationIncludingGravity.x;
var y = e.accelerationIncludingGravity.y;
var newx = x * 100
var newy = y * 100
var finalx = Math.round(x);
var finaly = Math.round(y);
document.getElementById("accelerationX").innerHTML = finalx
document.getElementById("accelerationY").innerHTML = finaly
speed = finalx * 10
document.getElementById("speed").innerHTML = speed
}
</script>
</body>
</html>