SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Live Feed

  1. #1
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Live Feed

    Hi, i want to add a live feed to the home page of my website, that captures the following activities for all people who use my site:

    - $username has just joined
    - $username has just updated their email address
    - $username has just changed their photo
    - etc...

    How should i go about capturing all of these? I have created a spreadsheet listing all of the activities that i want to capture... so should i just add an activity to a live-feed table in the database, each time one of these activites occure

    ========
    LIVE-FEED
    ========
    - id
    - timestamp
    - activity_desc


    Do you think this is the best way to set up / run the live feed, thanks in advance

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,069
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    We have one of those at work. Basically you indeed insert a row in the database for every event (we use MongoDB as the database for this because it makes it extremely easy to log all kinds of related data with it) and then on a website just poll every n seconds with AJAX to see if there is anything new, and if there is show it. You can also use long-polling, but I don't have any real world experience with that so I'm afraid I can't really help you there but the idea is that you make a request and then just wait forever until something arrives, and when it does you process that and do a new request where again you wait forever, etc.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool, thanks for your help...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •