Brad Fitzpatrick (bradfitz) wrote in lj_dev,
Brad Fitzpatrick

mode=live !

I've been working on a kick ass LJ feature the past like ... uh, hour or so.

I was going to do it a clean way, but since nobody obeyed the spec, I then had to do it a netscape-proprietary way, but since IE doesn't support it, and Mozilla won't support it, I ended up doing it another kinda clean way, but I had to use frames and javascript.


Anyway, tack on ?mode=live to the end of your friends page....

There are two frames... a 100% frame showing your friends list and a 0% frame that reloads every 20 seconds... that frame hits friends?mode=livecond with a &lastitemid= parameter... it's very quick to find the last itemid of your latest friend's post, so I then compare it... if it's the same as last time, I just show a blank page and send the Refresh HTTP header again (oh, which I'd like to point out there is no spec for... IE and Mozilla both support two different ways of doing it, but not the same two ways!).

Anyway, if the friends page has changed, then some javascript is spit out that reloads the top frame. but I think I got the JavaScript wrong... I think I reload the whole frameset... actually, I know I do. this is ugly and makes everything flash white.... somebody want to send me the correct javascript?

yeah ---- fun stuff.

not sure if I should release this to everybody or just paid users... it's still a little more resource intensive, ya know?


in IRC we were discussing making it free for free users, but with a 60 second delay instead of like 15 seconds.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded