Вопрос

I'm working on a Meteor app and I want to add a feature that would say how many people are on the website at a time, similar to omegle.com where it says "38,000+ online now" or whatever. Is this possible with Meteor? If it is, I have no idea how to execute it, and that's why I'm asking it here. Does anybody know how to do this?

Это было полезно?

Решение

You can use presence package for that purpose, see https://atmospherejs.com/package/presence . It provides the live data on the user state. For example, the easiest way to get the number of online users is:

Presences.find({online: true}).count();
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top