shiny happy glowy (afuna) wrote in lj_nifty,
shiny happy glowy

Greasemonkey scripts for the Message Center

Note: I've set up a page with all my Greasemonkey scripts since I first made this entry.

I come bearing scripts!

What you need before installing: Greasemonkey extension and Firefox

What they do:

  1. Display extra information when viewing notifications and subscriptions ( (actual script)

    • Show entry subject for comments in the message center.

    • Show the time a subscription was last active when viewing the list in your manage settings page. The time increments are divided into seconds, minutes, hours, days and weeks, and you can change the color of each time unit to easily highlight recently active threads or inactive threads (for when you're cleaning out moldy old subscriptions).

  2. "Pin" a notification to your message center so it won't be lost in a mass-deletion. ( (actual script)

    Basically, it prevents a message from being selected by the "select all" checkbox at the top. However, the message will still be marked as read when you use the "mark all read" button, and it will still be selected if you click on the notification itself.

  3. Select multiple subscriptions for deletion ( (actual script)
    Clicking on the trash can selects it for deletion but doesn't reload the page; clicking on delete actually reloads the page/performs the delete

There are several limitations in the way I decided to do the scripts.

First, the data is saved locally, in your Firefox profile on your machine, so it might not be accurate if you regularly surf on different computers or switch between browsers. I believe this is the only one that affects both scripts. The other limitations only affect the first script, which stores additional information for notifications and subscriptions.

I decided to store the data as you visit the message center, so it's only aware of the inbox pages you've visited. It's a similar limitation to the first one, actually. I made a conscious decision not to do any requests to fetch the data in realtime because it's a bit of a pain (read: feels inefficient) to have to call and scrape data from the page each time.

Also, due to parsing and efficiency issues, it's not designed to work with noncomments (example: new journal entries, userpics), or mass subscriptions (example: all comments to entries in your journal).

Final note: the data for entry subjects are refreshed when you visit the manage settings page, because that has the list of all your subscriptions. They're also stored at the moment you track an entry (to be precise, when you reach the interim page with the checkboxes). However, the time of most recent activity is only updated when you are in your message center. I've been asked by murklins to put in a button to update the recent activity times, and I plan on eventually doing it, but umm. Not yet ;)

Comments and suggestions much appreciated!

Realized the need for better handling of other languages, as pointed out to me by didaio in this thread. Don't expect it by tonight, but I'm working on it.
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded