Monday, July 23, 2007

This version of TinyBuddy IM converts the code to iUI for look and feel, and to Dojo 0.9.0beta for the JS part. As part of the conversion, the following featureshave not been implemented yet, but I am planning to get to them in a coming release:

* No Custom Away messages* Cannot show buddies by group (only alphabetic listing).* Typing events received from buddies is not implemented.

Tuesday, July 17, 2007

Here are some things I'm looking at for future TinyBuddy IM releases. I hope that most of these will make a v3 release, but we'll see how it goes:

* Convert the UI to follow iPhone standards as demonstrated by iUI. I'm not sure yet if I can use iUI straight out of the box, but I'll be looking at it, if anything for inspiration (The main issue could be licensing/legal stuff -- if I want to open source my code, I need to have some very clear code copyright/licensing history. More info below).

* Try to open source the TinyBuddy code.

* Offer an https option, so that all IM traffic is encrypted.

*Add a preference on the sign-in screen to specify whether to use the alphabetic buddy listing or use the AIM groups for buddies.

Feel free to offer other suggestions. Keep in mind I want to stay true to these principles:

* Stick with pure HTML/CSS/JavaScript for the interface.

* Continue to rely on the AIM servers for logging in the user, so the code does not see the user's password.

* Make it possible to open source the code, perferably to the same standards that Dojo uses for its code (clear tracking of who added what to the codebase, offer the option of either Academic Free License or the BSD license on the code).

Sunday, July 15, 2007

Today I did a small update to TinyBuddy IM (about). I'm calling it the v2 release. As I do a release, no matter how small, I'll just up the v number.

The biggest change is in response to Trevor's request for grouping. I had support for showing buddies by group before I had the iChat-like alphabetical buddy listing, but I had to work out an application switch and update the styles a little bit.

The upshot: if you put a bl=group on the TinyBuddy IM URL, the buddy list will show buddies in groups:

Groups can be collapsed and expanded. Leave off the bl=group to get the normal alphabetical buddy listing.

Other things that were updated:

* If you are typing a message and a new IM comes in from another buddy, there will be a notification in the current IM pane.

* A Send button in the IM pane. It seemed like a couple people didn't realize that the bottom text box was for typing and sending IMs. I hope having the explicit button helps. It also makes makes the UI mostly usable (if a bit small) on a Nintendo Wii. :)

* Some small style changes.

I also think that .mac accounts should work since they use AIM behind the scenes, but I'm not totally sure on that. If someone with a .mac account can give it a try and post the results, I would appreciate it.

On the release: I tried getting the scrollTo thing to work as Kai
suggested, but I think the Dojo AccordionContainer is doing some weird
sizingthings that makes the window.scrollTo calls not "hide" the
address bar in iPhone Safari once I show the buddy list. So more
investigation needed there.

I'm going to use an AOL Journal for now to log my TinyBuddy IM notes. I looked at using a Blogger blog (since I use one for my other blog), but there were some specific iPhone-related features for going with the AOL Journal.

My biggest problem with Blogger, is the mobile blogging. Right now, it only accepts email addresses from one of the cell phone networks. Since mail on the iPhone is just regular mail it does not work. Blogger has an email-to-post option, but it does not accept pictures.

An AOL Journal allows email-to-post with pictures, so it is a great way to get pictures off the iPhone and up somewhere. I can also use IM (TinyBuddy IM!) to post blog entries. I IM the AOLJournals bot to do it. It's like blog posting on the command line.

My biggest negative for the AOL Journal: lack of anonymous comment support. So, if you want to leave an anonymous comment, post an comment to this blog entry on my other blog: [link removed Oct. 4 2007].

(Update Oct. 4, 2007: I have rethought the value of anonymous comment support. The vast majority of posts were either spam or not on-topic, so I am removing the entry on the other blog that allowed anonymous posts. I now think it is good that the AOL Journal does not support anonymous comments. There can still be issues with authenticated comments, but anonymous comments are worse.)

The really neat thing about this is that you can register your email address as a valid AIM-recognized identifier. Just about any email address. If you register whatever@yahoo.com, you can now use that to log into AIM/TinyBuddy IM (you can't see the Yahoo Messenger people though, this is just an identifier that is used on the AIM network).

Same thing with the OpenID support -- if you go to other web sites that accept OpenID, you can plug in this URL to sign in (using the whatever@yahoo.com example):

http://openid.aol.com/whatever@yahoo.com

Neat, but weird.

Note: if you do use your email address as an AIM identifier, and you leave a comment on this blog, your email address may appear in the comment. I'm not sure if this opens it for collection by spam bots, but be aware that it may be visible on the page.

In a future post, I'll explain how to set up your iPhone so you can post to an AOL Journal via email, including sending a picture.

The
nice thing about this solution: you do not send your AIM password to me
-- you are redirected to AOL's OpenAuth servers for authentication. My
JavaScript only sees an auth token. Furthermore, my web page has to get
your explicit consent before accessing your buddy list data and before
sending the first IM or presence change.

So the price of this
added security is pop-up windows. A new window will be popped so you
can authenticate with the OpenAuth servers, and also when giving
consent to the application to access your buddy list and IM. For the
consent prompts, you can choose "Grant Always" to avoid them on
subsequent logins. I think the pop-ups are worth the added security,
and at least in iPhone's Safari, window popping looks neat.
Unfortunately, the OpenAuth Sign In and Consent pages are made for
larger windows, so you will have to double-tap zoom to read them.

Another
neat feature of this web application: it is pure JavaScript, HTML and
CSS. No server-side languages needed. Dojo really made it easy to do
this. I used Dojo 0.4.3 because I want to reuse this code for some
other projects that are on 0.4.3, but if/when I get enough time, I
would like to port it over to the 0.9 code.

So give it a whirl
if you like. I'm sure the code it not bulletproof, and I've noticed
enough weirdness with iPhone's Safari to guarantee that I will not be
able to give comprehensive support. Also, even though I'm an AOL
employee, AOL does not endorse this project or have anything to do with
it (but thanks to my co-workers for ideas and early testing, all done
of their own accord).

Also, I'm using an OpenAuth dev key, so if
there is too much usage you might see some rate limit errors, but we'll
see how it goes.

Some other interesting tidbits:

The
Web AIM API is a Comet API. It uses long polling to work cross-domain
in the browser. I'm using more of a short poll with pauses between the
polls to hopefully smooth out network hiccups on the phone.

Don't like the CSS? You can make your own and tell the app to use it instead. Go to the test launcher page
to specify the path to your CSS. Click the Launch button, then copy
launch URL. Use that URL when you want to use the application. This
feature is not allowed for IE browsers given its security problems with
CSS "expressions".

I'm serving the code gzipped. The HTML, CSS and JavaScript combined come to about 90 KB. So it is tolerable on the EDGE network.

Use the iPhone two finger scroll to scroll the buddy list and IM conversations.

Typing
IMs should be optimally sized for use with the virtual keyboard. Just
type in the text box at the bottom of the IM window and press "Go" on
the keyboard.

I'm using Dojo Accordions for the IMs and buddy
list. I like the use of space with that model and that I can show you
incoming IM text if that IM AccordionPane is in the closed position.

onbeforeunload
does not seem to fire for iPhone Safari. That makes it hard to log out
correctly, so to clear your OpenAuth cookies, be sure to use the
Available, Sign Out menu item.

To use TinyBuddy IM, just type http://tybyim.com in the iPhone Safari browser. You can try it in other browsers, but it looks best in the iPhone Safari.