New Comments May 2, 2006 12:05 PM   Subscribe

Would it be possible to show how many comments have been made on a thread since the last time you clicked on the thread, not since the last time you loaded the page?
posted by _sirmissalot_ to Feature Requests at 12:05 PM (14 comments total)

that would be awesome
posted by exogenous at 12:25 PM on May 2, 2006

That means that instead of one time per user, now you have to keep one time per user per thread. Which is a lot more.
posted by smackfu at 12:26 PM on May 2, 2006

as awesome as this idea is, that sounds like a lot of server load.
posted by shmegegge at 12:28 PM on May 2, 2006

yeah, I'd have to track every thread every user ever looks at. It's a bit much. I'm sure some greasemonkey script could be written to store timestamps on the client side and tell you what is new.
posted by mathowie (staff) at 12:32 PM on May 2, 2006

Or say hello to per-thread cookies.
posted by klangklangston at 12:34 PM on May 2, 2006

would handing out thousands of per-thread cookies work? It seems like I would run up against the cookie filesize limits in browsers really quick.
posted by mathowie (staff) at 12:58 PM on May 2, 2006

Sounds like a job for greasemonkey - not that I'm competent to write the script or anything.
posted by exogenous at 1:07 PM on May 2, 2006

You're officially allowed at least 20 cookies per host/domain. In practice, you're not getting any more than that though, and given that metafilter currently already sets a few cookies, I don't think it's viable.
posted by fvw at 1:16 PM on May 2, 2006

Eh, it could be done with one cookie using key-value pairs up to the maximum cookie length of 1024 characters. When you load a page that thread's date gets moved to the front of the cookie so that the cookie holds the most recent 30 or 50 (however many fit) datestamps. Should be good enough.

Kind of a pain though.
posted by kindall at 1:37 PM on May 2, 2006

Wikipedia says maximum cookie length is 4kB, so that would be a lot of threads and comments.

2 bytes for thread number and 4 bytes for comment number, that is 600+ threads of memory. You could compress it a lot more by remembering comments relative to thread instead of the absolute comment number..
posted by Chuckles at 3:36 PM on May 2, 2006

While 2 bytes for thread number would be sufficient if you converted all thread numbers to binary, it would be pretty impractical. Instead, I'd say 1 byte per digit, so 5 bytes for thread number, one for a hyphen or the like, 3 for the comment number, and one for a row divider. So 10 bytes per thread, for 400 threads.
posted by Bugbread at 3:47 PM on May 2, 2006

(er, by impractical, I meant the effort involved, not the end result)
posted by Bugbread at 3:47 PM on May 2, 2006

Actually, you could Base64-encode it and get the thread number and the date into, say, six characters if you made the fields fixed-width. That's good up to nearly 250,000 threads and 682 years since whatever day is chosen to be zero-day (I'd suggest the day MeFi opened). So, 680-ish threads could be tracked this way. If you go by comment number you can get it into five bytes per thread, and track 800 threads.
posted by kindall at 6:07 PM on May 2, 2006

Is there some reason you would want to track more than just the first page?
posted by smackfu at 6:18 PM on May 2, 2006

« Older Why don't people add tags?   |   clarificaiton wanted, derail not wanted Newer »

You are not logged in, either login or create an account to post comments