Apr 11

Reply hooks in Gmail; A case study in over-engineering

Tech with tags: , 6 Comments »

Before I start, I have to get it out that the thinking in question took place at 5am. I have been enjoying time in Europe, getting to meet various developers on the On Air tour that Adobe was kind enough to have me speak at. Since I was in Europe for such as short period of time, and due to a few work matters, I ended up staying somewhat on US time. This never quite works, and I think I end up with my body clock tick-tocking somewhere over the Atlantic. If I ever had to crash land on that tiny American runway on the side of a volcano, I am sure I would sleep fantastically at 10pm.

Anyway, to the matter at hand. These emails drive me nuts:

Title: Bob Harris via Twitter to me

"Some random content in 140 characters or less"

Bob Harris / bobh

--
follow me at http://twitter.com/bobh
reply on the web at http://twitter.com/direct_messages/create/bobh
send me a direct message from your phone or IM: D BOBH your message here.
turn off these email notifications at: http://twitter.com/account/notifications

You get them from Facebook too (thankfully they put the random content in there for some of the content), and many other services out there.

What is wrong with them? This is how they come across to me:

  • Hi, this is Twitter
  • I know that you are reading this in your email client
  • And here is some content to read
  • You very may well want to reply to this
  • I am going to tell you how to do so in many ways
  • But I won’t let you actually use email even though that is your context!

I got angry one night (after some dark and stormys, white russians, …) and wanted to fix it.

This lead me down the path of Greasemonkey. How about greasing up the wheels like this:

if the title of the message has / from Twitter to /
  when pressing the "r" key to reply or clicking on the reply button
    open up IM with "d [get reply to]" (grab /IM: D \w+/)
      now you can put in the message

The problem is that tying into all of the actions can be a pain, and it is a little bit annoying to be running this on every email. Oh, and what about the other sites! We don’t want to have to repeat this for every service that doesn’t care about me, do we?

After all of this over-engineering it seemed obvious that I shouldn’t be lubbing up the ape, but Twitter should handle this for me, and thus everyone that uses Twitter.

Instead of Twitter emailing me as <noreply@twitter.com> how about if a gentler, more Oprah-like Twitter greeted me as <pleasereplytoyourmate@twitter.com>. Then the email becomes:

Title: Bob Harris via Twitter to me

"Some random content in 140 characters or less"

Bob Harris / bobh

--
simply reply to this email, and the first 140 characters will be posted

or,

follow me at http://twitter.com/bobh
reply on the web at http://twitter.com/direct_messages/create/bobh
send me a direct message from your phone or IM: D BOBH your message here.
turn off these email notifications at: http://twitter.com/account/notifications

The 140 character limit could be one of the reasons that they don’t do this? Stripping could cut the message up, but if this was the case, I would get the monkey out again and write something to help enforce the limit by letting the user know as they types too much.

Having nice extension points to email sounds pretty interesting to me too. What if Gmail adding to the Greasemonkey JavaScript API so you could add event listeners to events such as: getting new mail, pre-reply, post-reply, typing a subject, adding contacts.

Think of the possibilities.

But, I still want services to take email seriously as an interface to them, as does Dopplr and some others. After all, doesn’t Stallman use email to browse the Web?

Nov 06

“Firebug can make Gmail slow”

Tech, Web Browsing with tags: , , , 2 Comments »

Man I love Firebug. How can you do web development without it? Unfortunately it does seem to slow down my general browsing experience now and then. Even when I have it disabled I see Firefox sucking down more memory, and taking longer to open new tabs and the like.

When I went to my Gmail account today I saw:

Gmail Firebug

Which links too Firebug can make Gmail slow:

If you’re using a Mac

Please note that if you’re using a Mac, you’ll continue to experience performance problems unless you disable Firebug for Gmail. To disable Firebug for www.google.com, please follow the steps below:

  1. Click the green or red icon in the bottom right corner of the browser window to open Firebug.
  2. Click the bug icon in the top left corner of Firebug and select ‘Disable Firebug for mail.google.com.’

If disabling Firebug for Gmail doesn’t improve performance results, you may have to entirely disable Firebug.

On Windows and Linux it suggests to turn off XHR logging (Firebug puts in a proxy XHR object to do all of the work). I wish that I could load up an instance of FF with it on, and one with it off…. I need to look into profiles again.

Nov 05

Gmail Greasemonkey Macros: Back, and Gmail even has support!

Google, Tech with tags: , No Comments »

Gmail recently got a JavaScript facelift which has subtle new features. For example, calendar attachments, smart top notices when you are disconnected and how the interface is retrying, and more.

However, most Greasemonkey scripts broke. This is bad news for me, as without Mihai’s macros script I feel real pain as I try to vi my way around the interface.

The new Gmail interface did add more keyboard shortcuts such as:

  • shift + i: Mark as read
  • shift + u: Mark as unread
  • shift + 3: Move to trash (not actually new, but not many people seem to know this one)
  • shift + 8 and a, n, r, u, s, t: Select all, none, read, unread, starred, unread

But, this isn’t quite enough. Luckily, Mihai has stepped up and ported over his work.

He has ported over:

  • g: Go to label
  • l: Apply label
  • b: Remove label
  • e: Archive (regardless of view, unlike “y”)
  • d: Discard (mark as read and archive)

and added:

  • f: “Focus” the current view (only show unread, starred or inbox messages)

What is really cool is how Dan Pupius and the team have truly acknowledge the Greasemonkey folk and have given us hooks to help us monkey around with Gmail:

For those of you adventurous enough to look at the script source, you’ll notice that it uses a gmonkey object that is present on the window, which in turn gets you a gmail object with methods like getNavPaneElement() and getActiveViewType(). What this means is that the version of Gmail, in addition to being faster, also has semi-official support for Greasemonkey scripts. I’m pretty sure official docs for this API will be out soon, but in the meantime, feel free to look at the script and use a tool like Firebug to investigate the properties of the gmonkey and gmail objects and play around.

Thanks Mihai and Dan!

Oct 24

Gmail now supports IMAP

Google, Tech, iPhone with tags: , , , 4 Comments »

I was really excited when I logged in to Gmail and saw the new settings:

Gmail Imap

I think this is my number one feature request for Gmail, so it is great to see it role out. Since Gmail is tag/label based, it isn’t as easy to implement IMAP as it may seem, so good job dev team!

The reason that I personally care is that I have been able to do this for my corporate account:

And now, I can finally do the same for my personal email account. Check out the automatic labels that you get.