Wednesday, February 18, 2009

Generalizing Twitter

I'm using Twitter now. So far it's pretty fun. I like being notified when interesting things happen (IM, twitter, new email). It's made me wonder whether it's feasible to create one event log to rule them all.

This event log would live in the cloud. Anything could notify the cloud that something "interesting" happened. It records that event in the log. For example, my tweets would automatically notify the cloud. When I leave my desk, it'd notify the cloud. As my phone detected a new geolocation, it'd notify the cloud. I'd soup up my toaster to notify the cloud when the toast popped up, etc.

Now what if it were programmable? I'd notify the cloud with a special event containing a small program and some conditions to trigger that program. For example, to automatically send me an instant message on Google Talk when the toast is ready:

    "event"  : "mndrix's toaster popped up",
    "action" : "xmpp_send('mndrix@gmail.com', 'Your toast is done')",

(The way of specifying event patterns needs some thought). This is kind of like JoCaml's concurrency model: events matching certains patterns trigger code. In the example above, events come into the cloud and that action just sits there doing nothing. As soon as the "mndrix's toaster popped up" event arrives, the cloud notices that it matched the precondition I specified, and it triggers my code.

If the service had a way to run a webhook, you could run arbitrary code when interesting events (or sequences of events) occurred. The event log in the cloud basically becomes a switch board where events come in, they're matched against patterns and new events are generated (infinite event loops, anyone?)

I think there's potential for interesting applications once you have access to tons of events outside your own personal sphere. For instance, to create an impromptu IM meeting once everyone is available: "if my wife and brothers are available on IM and I'm not on the phone, create a chat room and invite us all". The condition is composed of the state of several people (inferred from previous events in the log). The action could be implemented with some XMPP scripting.

Wednesday, February 4, 2009

GNU screen for Phones

I'm a big fan of GNU screen. One reason is that when a bad 'net connection (or a two year old) disconnects my ssh session. I can reconnect to the server and reattach to the previous session without any lost work. I'm currently in an area with really bad cell coverage. It would be great if there were a GNU screen equivalent for cell phones. I'd call a phone number in the cloud and have it dial out to my final destination. If my cell phone dropped the call, the service would announce to the parties on the line "Michael's phone got disconnected. He'll be right back". The service would then call my cell phone. As soon as I answered, I'd be reconnected to the previous call.

The same thing could work for incoming calls. I'd provide others with my number in the cloud. When a call came in, the service would call my cell phone and patch the call through. If I lost the connection, the same scenario would play out.

Another idea is that I could call a customer service phone number (via the service). When I'm put on hold, I could dial *99 (or something) and then hang up. Once I'm off hold (detected somehow or other) the service would call me back and I'd be connected to the customer service representative.

I'm sure there are lots of other cool features that could be implemented. They key is having a single layer of indirection in the phone system between my phone and the rest of the world. Google's GrandCentral service has the potential for making this possible. It also seems like one could hack up an Asterisk application to do this.