GMail command + feedback

5 views
Skip to first unread message

Ivan Zuzak

unread,
Jul 27, 2008, 1:46:09 PM7/27/08
to ubiquity-firefox
Hello all,

I just uploaded a "gmail" command to the Files repo (http://ubiquity-
firefox.googlegroups.com/web/ubiquity_gmail.js). The command checks
for new e-mail on GMail using an atom feed available for each GMail
account (see http://gmail.google.com/support/bin/answer.py?answer=13465)
and displays the first 3 unread messages.

My first impression after creating a command was that the overall
process is awesomely easy. The built-in command editor is great to
have, the new command format based on the CreateCommand factory
definitely improves readability, and the bookmarking+tagging method
for storing new commands is very simple.

In the future, I'd like to see more ideas for commands that are
process oriented, not just for information retrieval. Aza hinted a few
possibilities in http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/1dad428fa71ad885#.
In my opinion, these process-oriented commands that execute some
process on the users behalf will be very valuable to end-users since
the whole Web is shifting in that direction. On that note, integration
with Weave in the future sounds like a big win.

Ivan

Ivan Zuzak

unread,
Jul 27, 2008, 1:53:18 PM7/27/08
to ubiquity-firefox
Well, ain't it nice how the url got massacred... Here it is again:
http://ubiquity-firefox.googlegroups.com/web/ubiquity_gmail.js

Cheers,
Ivan

On Jul 27, 7:46 pm, Ivan Zuzak <izu...@gmail.com> wrote:
> Hello all,
>
> I just uploaded a "gmail" command to the Files repo (http://ubiquity-
> firefox.googlegroups.com/web/ubiquity_gmail.js). The command checks
> for new e-mail on GMail using an atom feed available for each GMail
> account (seehttp://gmail.google.com/support/bin/answer.py?answer=13465)
> and displays the first 3 unread messages.
>
> My first impression after creating a command was that the overall
> process is awesomely easy. The built-in command editor is great to
> have, the new command format based on the CreateCommand factory
> definitely improves readability, and the bookmarking+tagging method
> for storing new commands is very simple.
>
> In the future, I'd like to see more ideas for commands that are
> process oriented, not just for information retrieval. Aza hinted a few
> possibilities inhttp://groups.google.com/group/ubiquity-firefox/browse_thread/thread/....

Atul Varma

unread,
Jul 27, 2008, 3:14:19 PM7/27/08
to ubiquity...@googlegroups.com
This is awesome.

Dietrich Ayala

unread,
Jul 27, 2008, 9:32:43 PM7/27/08
to ubiquity...@googlegroups.com
> On that note, integration
> with Weave in the future sounds like a big win.

You can "install" ubiquity commands by bookmarking a script and
tagging it with "ubiquity". Any commands "installed" this way should
get Weave syncing for free!

-d

Ivan Zuzak

unread,
Jul 28, 2008, 4:38:13 PM7/28/08
to ubiquity-firefox
Yes yes, that's a wonderful "freebie" from Weave!
I was thinking of a more deeper integration of Ubiquity with Weave
with the goal of allowing commands to store small amounts of command-
related data in the cloud. This could be done by explicitly exposing a
part of Weave with a simple api for command developers, or implicitly
syncing some storage object used by Ubiquity. Interestingly, I've yet
to think of a good use case for this. I guess the Clipmarks addon Aza
pointed to just got me thinking (https://addons.mozilla.org/en-US/
firefox/addon/1407).

Ivan

divinitas

unread,
Sep 4, 2008, 11:24:29 AM9/4/08
to ubiquity-firefox
I have changed this command a little bit

changes:
1. at first it shows in wich label you are and the count of new mails
2. you can look in labels like: all, chat, trash, spam and your own
labels
3. now the from email-address is also shown

Source:

//----------------------------------------------------------------------
// Gmail
//----------------------------------------------------------------------
CmdUtils.CreateCommand({
name: "gmail",
icon: "https://mail.google.com/mail/images/favicon.ico",
takes: {"in label" : noun_arb_text},
execute: function() {
Utils.openUrlInBrowser( "https://www.google.com/accounts/
ServiceLogin?service=mail");
},

preview: function( pblock, directObj) {
var lab = directObj.text;
var url = "https://mail.google.com/mail/feed/atom/" + lab;

jQuery.get( url, {}, function(feedXml){
var entries = jQuery("entry", feedXml);
var tag = jQuery("feed", feedXml);
var label = "";
var text = label;

tag.each(function() {
var tag = jQuery(this);
var tagline = tag.find("tagline").text();
var count = tag.find("fullcount").text();
label += count + " " + tagline + "<br/><br/>";
});

if( entries.length > 0 ) {
var maxEntries = 3;
text = "";

entries.each(function(i) {
if( i < maxEntries ) {
var entry = jQuery(this);
var link = entry.find("link").attr("href");
var title = entry.find("title").text();
var author = entry.find("author name").text();
var email = entry.find("author email").text();
var summary = entry.find("summary").text();


text += "<a href='" + link + "'><b>" + title + "</b></
a><br/>";
text += "From: " + "<b>" + author + "</b>" + " '" + "<a
href='mailto:" + email + "'>" + email + "'</a><br/>";
text += summary + "<br/><br/>";

}
});
}

pblock.innerHTML = label + text ;
});
}
});
Reply all
Reply to author
Forward
0 new messages