October 11, 2007

Supporting YC News

Yet another episode of tracking changes to websites. If you frequent YC News, this greasemonkey script will highlight stories on the front page with fresh comments since you last visited them. On pages with comments it will highlight fresh ones. Finally, it provides easy access to the list of monitored stories; you can stop monitoring a story when you want to.

Inspiration

This script identifies new comments by storing and comparing timestamps. Though obvious on hindsight, this wasn’t the first approach I tried. The inspiration for comparing timestamps rather than full-text came from two sources:
  • A conversation on reddit when I created the hystry plugin for it back in June.
  • A conversation with Waleed Abdulla in response to his bookmarklet to address the same problem. This script is based on his bookmarklet, and on the insight that translating bookmarklets to greasemonkey scripts is trivial.
  • Tradeoffs

    Prior hystry plugins maintained multiple versions per page and performed full-text diff. Comparing timestamps rather than full-text requires specialized parsing for each new website to identify comments, their permalinks, and their timestamps. It also imposes limits on the number of pages we can track per site - browser limits on the number of cookies per site range from 20 to 50. On the other hand, this approach requires less disk space, bandwidth, and computation. It stores user-specific timestamp information in browser cookies rather than on the hystry.com server. Indeed, if you don’t care for highlighting new comments on the front page, this version doesn’t need to contact hystry.com at all, and is fully self-contained in the browser.

    Highlighting and notifying

    This is the third plugin on hystry.com. Each plugin has been an attack on two mostly-independent problems: highlighting updates on a page, and notifying you of pages with updates. Highlighting updates has worked well each time, but notification has been hard. I first tried the inbox, but it was slow to load and I found myself reluctant to use it. In the second version, I gave up on notification and simply highlighted updates in place when you returned to a page. I found I rarely return to pages. This version integrates both highlighting and notification into the look and feel of the site you’re on. But it only works for one site. Now let’s see what we can do about that..