This is a mirror of official site: http://jasper-net.blogspot.com/

Introducing Gmailr: A Javascript API for Gmail

| Monday, February 7, 2011
I'm happy to announce that I've decided to open source Gmailr, a Javascript API for Gmail. It's the code that is used to run one of my pet projects, 0Boxer, which is an extension for Gmail that turns organizing your inbox into a game.

A few days ago, the 10,000th user signed up for 0Boxer, so I figured this would be a great time to share some of the code that makes the realtime gaming mechanics possible. Go ahead, grab the code and play with it, make your own extensions and apps, and improve it!

A Thorny Road

Developing the code behind Gmailr was fraught with frustration and dead ends. There is no currently supported official javascript API for Gmail. There was a greasemonkey script that was released a few years ago, but is now broken, with no plans from the Gmail team to fix it.

Also, no one else (as far as I know) has released any kind of frontend API for Gmail. And, in order for my app to work, I needed access to the various user actions in the UI — the backend APIs weren't going to cut it. So, I was stuck writing my own library from scratch.

But this was no easy task. Gmail runs its code through the closure compiler, thereby obfuscating everything. On top of that, Gmail is probably one of the most sophisticated javascript apps out there. Needless to say, I am now intimately familiar with the various DOM elements that make up the Gmail interface, as well as how the data is transported.

Read more: Hi, I'm James Yu

Posted via email from Jasper-net

0 comments: