title: Firebase - Count online users
body: <p>I tried using <a href="https://www.firebase.com/docs/managing-presence.html" rel="nofollow noreferrer"><code>presence</code></a> to make it display the total connected users in an element. I can't really figure out how to make it work.</p>
  <p>I also tried doing the following:</p>
  <pre class="lang-js prettyprint-override"><code>    var dataUlist = new Firebase('https://&lt;url&gt;.firebaseio.com/.info/connected');
      dataUlist.on('value', function(snap) {
          console.log(snap);
      });
  </code></pre>
  <p>To tried to see if I could find anything useful in there, but I couldn't figure out how the data works.</p>
  <p>Is there any way to accomplice what I am after? Fetch the total number of connected users and then echo it out in the console or to an element?</p>