title: Using Socket.io and iPhone Accelerometer
body: <p>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. The Variables are changing multiple times a second so I was thinking of using Socket.io, does anyone know how i would go about this? I would greatly appreciate any help I can get. Thank you.</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;div id="content"&gt;
      &lt;h1&gt;Accelerometer JavaScript Test&lt;/h1&gt;
  &lt;ul&gt;
      &lt;li&gt;acceleration x: &lt;span id="accelerationX"&gt;&lt;/span&gt;&lt;/li&gt;
      &lt;li&gt;acceleration y: &lt;span id="accelerationY"&gt;&lt;/span&gt;&lt;/li&gt;
      &lt;li&gt;Motor Speed: &lt;span id="speed"&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;script type="text/javascript"&gt;
  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
      }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>