I checked out the web2py.js file and it looks like what i'm looking for is 
right in there but i really do not know how to implement this. I realized I 
can take advantage of the web2py_websocket function's onopen argument and 
write a function to tell that that user is online, and when the browser tab 
or window is closed, I'd write a function to execute for onclose.

The problem I have now is what function to write. I want to store the ids 
of all the connected users somewhere so i can refer to it and use it to get 
whatever information i want (i.e. a count of all users online, urls to 
their profile pages, etc), and then when they close the page, their ids are 
removed from wherever i'm storing it.

Is it possible to keep that list of ids in a database, or a list, and still 
update the page in real time when more users connect and disconnect?

Scenario.
There are 0 users online right now. When I visit the website, I want to see 
the number automatically say 1 users online. and when my friend also goes 
to the page on his computer, I want to see in my browser 2 users online. 
When he leaves the page/closes the page, I want to see in my browser 1 
users online without having to refresh the page.

I don't know if I'm thinking about this correctly so I need some help and 
guidance here, thanks.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to