Wednesday, March 5, 2014

Re: Showing which users are viewing a given page

On 04/03/2014 13:06, Paul J Stevens wrote:
> On 04-03-14 13:28, Some Developer wrote:
>> Hopefully someone here will be able to point me in the right direction.
>>
>> Basically I want to be able to view which users are viewing a page at
>> any given time and I want to be able to update it in real time using
>> JavaScript but I'm at a loss as to how to track which users are viewing
>> any given page in Django.
> So enter some long-polling javascript that notifies the server every X
> seconds that some user is still at the page you're tracking.
>
>> So for instance if I had mydomain.com/page/ I'd like a little box on the
>> top of the page saying "Page being viewed by users: xxx and yyy" and
>> then when one of those users navigates away from the page the box
>> updates to remove that user from the list.
> This means that apart from the "I'm still here", you also need a "Who's
> here at" as well.
>
>> I'm not sure if I have described what I want clearly enough so if you
>> need any more information let me know. Any help is appreciated :).
> So for each page you want to track:
>
> use a settimeout loop in javascript to:
> - do a POST to some mini-view where you register who's at some page. You
> can use the REMOTEUSER (auth-user) to find out who's who, and the
> Referer header to see where they are in your site.
> - this POST returns some data (json?) that will tell you who else is
> there. You can now update your DOM to reflect this information.
>
> If you don't want or care about authenticating users, you can't know who
> is actually at the page, just the number of people, and their IP
> addresses, browser version, etc.
>
> Of course some people have done this before. Maybe check out TogetherJS
> for more real-time collaboration goodies.
>
Thank you for the information; it is helpful. Along with the other tips
here (I hadn't thought of using socket.io which looks really useful) I
should be able to hack something together to get this working.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5316FDA8.3010105%40googlemail.com.
For more options, visit https://groups.google.com/groups/opt_out.

1 comment:

  1. A lot of people have been helped by instant payday payday loans uk but they knew exactly what to enter, and are prepared to face them just because. Make sure you understand what is expected and can take advantage of the full benefits of instant payday loans.
    payday loan and savings in his bank balance is insufficient to meet emergency expenses provides financial assistance to a person. These are basically short term unsecured market fund is a product.
    An individual can give financial support, so 3 month payday loans are designed in such a way. And he is mature enough to get a next payday. Usually, term loans varies from 15 days to 20 days, but sometimes at the request of the borrower lender can extend the term for the next payday.
    Your 3 month loans is the unsecured market fund products, so there is no need to keep any collateral lender, as I said. Generally, collateral, or people who do not want to place collateral gets attracted towards personal payday loan not in a position to place.

    For more info :-
    http://payday3monthloans24hrs.co.uk
    http://3monthpaydayloansanytime.co.uk
    http://3monthloanstopocket6uk.co.uk

    ReplyDelete