Archive for the ‘Greasemonkey’ Category

Greasemonkey Script: Gmail Unreads Summary

Saturday, Aug 8th, 2009
Comments
88845b68be70a788f255ae423e72db98 Del.icio.us

I am a heavy-user of Gmail and Google Apps, and I spend most of my day in either’s web interface. The great thing about using the web interface is that I can either customize it with Gmail’s Labs feature, Firefox extensions or Greasemonkey scripts. Lately, I encountered this problem with my inbox which I felt warranted a scripted solution, and so, I spent a little time to get acquainted with Greasemonkey again and wrote a simple one.

First, the problem.

The thing I dread most with opening my inbox every morning is that it’s always flooded with (duh?) emails. The speed at which emails are being sent nowadays is astonishing! After every night, my inbox is usually packed with emails from colleagues, partners, applications (automated notification), newsletters, spam and others. That’s a night’s worth, so consider my feelings after a long weekend.

Anyway, just for the record, I LOVE to adopt a zero-inbox policy, and I archive my emails VERY, VERY LIBERALLY, so if my inbox is teeming with 30-40 unread mails, that’s considered “full” or “flooded” to me. =)

To tackle the flood, I started with filters and that helped, but I am still not satisfied. Every morning, I’ll start the day in my inbox and traverse down the long, long list of unread emails to read, reply, archive or delete. However, at any single point in time, I’ll only know the number of unread emails I still have in my inbox, and no further details about these emails. Hmm.. Is there anything that I can do?

And now, the solution.

An idea struck me this morning, and I decided to give it a try. After tinkling with Greasemonkey scripting and Gmail’s Greasemonkey API for a while, I present to you: Gmail Unreads Summary!

Preview of Gmail Unreads Summary

The features of this Greasemonkey script are:

  • Summary of unread emails in your current view.
  • Emails are grouped by sender, with unread count.
  • Every group is a quick link to filter emails by sender.
  • Easy to use!

Download Now!

Anyway, my original intention is to create a summary for ALL the unread emails in your account. However, it’s impossible to get all that information from the client-side? Therefore, as a workaround, the summary view is only for the CURRENT VIEW which you are looking at, and the summary changes when you paginates or change views.

Give it a try! Any feedbacks? Would you like to see any other summary details?

Hmm.. I wonder if this is worthy of Gmail Labs..

Update (20-08-2009)
I have removed the “Close” functionality and replaced it with a “Toggle” functionality. This is because the “Close” functionality is buggy (as it used a GM value?) when installed as a Firefox extension. Download the script again. Thank you!

Update (29-08-2009)
I have made some bug fixes to the script to improve your overall user experience. Firstly, search urls will now make an in-browser refresh and not a full-browser refresh. Secondly. emails with “+” are now searchable too. Download the updated script. Thank you!

Update (30-08-2009)
As reported by users, the “minimize” functionality is not sticky after changing views. Therefore I have updated the script to ensure that your preference is remembered. Download the updated script. Thank you!

Update (11-09-2009)
This script has been integrated into the Firefox add-on: Better Gmail 2 since Aug 18th. Thanks to Gina of Lifehacker!

Update (20-09-2009)
This script has been removed from the Better Gmail 2 extension since version 0.9.4 because I am using a new Greasemonkey function (@require) which is somewhat incompatible with the extension. Please install this as a Greasemonkey script instead.

Update (26-11-2009)
The Gmail Greasemonkey API broke (possibly due to changes within Gmail itself), which caused the Greasemonkey script to stop functioning. I have just fixed the bug, so go ahead and download the updated version. Thank you!

Update (16-02-2010)
The Gmail Greasemonkey API broke again. I have fixed two of the broken functions, but not the third, and so, my script has lost the functionality of “auto-refresh”. However, I have added a “Refresh” link, so that refresh can still be done manually. Hopefully this is a good-enough fix for now. Please download the updated script. Thank you.

Update (21-02-2010)
In this update, I have renamed the “Refresh” link in the last update to “Refresh GMUS” and have shifted its position – putting it just beside Gmail’s own “Refresh” view link. Download the updated script now. Enjoy!

Update (21-03-2010)
I made a minor update to the code and bumped version up to 0.2.1.

AND.. I released a Google Chrome extension of the same functionality! Hurray!

Update (29-03-2010)
I just pushed an update to UserScripts.org which fixes a few bugs in the last release. In addition, the sender groups are now sorted by count, in descending order.

Download the updated script now. Thank you!

Bookmark & Share
Subscribe to WinstonYW

Tweak: Gmail and Reader Integrator

Tuesday, Nov 7th, 2006
Comments
e383282d97ff000944358bb0beb450ad Del.icio.us

Editing the Sizes of the Split-Windows

Suppose you wish to edit the sizes of the split-windows for Gmail and Reader Integrator, this is possible and easy to accomplish. Follow these steps to customize the Gmail or Reader window sizes to your preference:

  1. In Firefox, open Tools > Greasemonkey > Manage..
  2. Click on “Gmail + Reader Integrator” in the left panel
  3. Click “Edit” button
  4. Choose a text editor, preferably with “Lines Number” display
  5. Go to Line 54 and 55
  6. Edit the sizes (in px)
Quick Tip 1:

In a 1280 x 1024 resolution, the height of an email row in Inbox is approximately 22px. Therefore, the default for “GMAIL_SPLIT_HEIGHT” is set as 220px which displays about 10 email rows in split-window view.

Editing the Size of the Reader Window (Gmail Collapsed )

By default, on collapsing the Gmail window while the Reader is open, the Reader would be resized to fill the height of a screen. Suppose you wish to further extend the height of the Reader when the Gmail window is collapsed, do the following:

  1. Search for function resizeReaderFrame, or Line 665
  2. Change “window.innerHeight – readerEmbed.offsetTop” to a large value
Quick Tip 2:

You can open|close the Reader window by clicking on the Reader link in the LHS navi. That link is like a “toggle” for the visibility of the Reader window.

Feel free to drop me a message regarding other preferred customizations?

Lastly, the response towards the script has been overwhelming. Thank you!

Bookmark & Share
Subscribe to WinstonYW

Greasemonkey Script: Gmail and Reader Integrator

Friday, Nov 3rd, 2006
Comments
98c71549d280d7f0af91f08e995aa1d7 Del.icio.us
Update on 6th August 2008

This script does not work with the new version of Gmail and due to misc. commitments, I am not able to devote effort and time to improve this script (as much as I would like to). For similar functionality and more, please take a look at LifeHacker’s Better Gmail 2 Firefox extension.

Thank you once again for the overwhelming response!

Update on 11th November 2006

Previously, if your default start-page in “Settings” was “Home”, it was redirected to “All”. This has now been modified such that no redirection occurs, and “Home” is displayed.

Thanks to David for pointing this out. Download the updated script.

Update on 9th November 2006

There is a programming bug, specifically a variable name error on Line 304 in the script. The variable name for the Google Reader shared items URL should be READER_BROADCAST_URL and NOT READER_SHARED_URL. Sorry for the mistake! Download the updated script, again.

Update on 6th November 2006

I removed the Reader view when “Contacts” link is clicked as it “damages” the interface. Download the updated script. No other changes to the rest of the script logic.

The Short Story

I wrote a Greasemonkey script that integrates Gmail with Google Reader.

Features

  • Spilt-window view of Gmail and Reader on a single page
  • Links to collapse|expand either Gmail or Reader
  • Integrated Reader uses start-page as specified in Reader’s “Settings”
  • Labels selector
  • Key ‘v’ to open Reader links in a new Window
  • Automatic resize of Gmail and Reader views

Requirements

Installation Instructions

  1. Install Greasemonkey Extension
  2. Click on THE SCRIPT (gmailreaderintegrator.user.js)
  3. Click “Install”
  4. Open Gmail and ENJOY!

Screenshots

GR_1.jpg GR_2.jpg
GR_3.jpg GR_4.jpg

The Not-So-Short Story

Recently when Google reintroduced Google Reader with a new look, new features and improved usability, they marketed it as the “Inbox for the Web”. Immediately, the word “inbox” associates the Reader to emails, and Chris Wetherell – Google Reader Engineer, explained that using the Reader to obtain the latest updates of your favourite websites is similar to reading your emails. You just wait for the updates to be sent to your inbox.

Within the same day, the Reader created a huge buzz and I gave it a try. Previously, I wasn’t accustomed to the not-so-intuitive interface of the historical version and so chose to use Rojo as my RSS aggregator instead. But after exploring the new Reader, I was excited about the changes which Google introduced and have started using it as my default RSS reader.

Then, I found this Greasemonkey script by Mihai Parparita, from a post in Lifehacker, which embeds the Reader into Gmail. This makes perfect sense! They both are inboxes and ideally, they should belong on the same page. Moreover, I use Gmail frequently at work and the interface integration is an amazing productivity hack.

However, I felt that it wasn’t adequate for my use, and that my wish-functionalities were similar to comments left on Mihai’s Blog and Lifehacker. Therefore, I decided to write my own script to integrate Gmail and Google Reader; even though I have never written a Greasmonkey script before.

By examining Mihai’s code, I was able to learn and understand how a Greasemonkey script is written with Javascript. Then, I took about 1.5 weeks to complete coding my version of the Gmail and Reader Integrator, with a list of features that brought more functionalities to the integration. Importantly, I should bring to attention that I reused certain functions written by Mihai for convenience, and I acknowledged these functions clearly in my script. Thank you Mihai for the inspiration and wonderful code.

Lastly, please do report any bugs encountered or feedback any suggestions for possible improvements. I hope that you would find my Gmail and Reader Integrator script useful, as much as I do.

Bookmark & Share
Subscribe to WinstonYW
Winston{YW} Copyright © 2008
Powered By Wordpress, JQuery and A Lazy Search Monkey