C:\COD> keepfakingit.com


C:\COD>display post(http://keepfakingit.com/battfone-the-update/)
Posted by on the 25th of April, 2009 at 12:15 am under Battfone, philanthropy and technology.    This post has no comments.

Battfone Development work
A month ago I was inspired to enter the Social Actions Change the Web Challenge. The closing date was mid April so unfortunately if the entered app, Battfone, was a horse it would be still out there running.

But let’s not worry about trivialities like that, changing the world is more important than winning coding competitions and collecting cash prizes. So with that in mind here’s an update to what I’m still trying to achieve with Battfone.

So what’s the big idea?

Here’s the detailed application overview used on the CTW site:

It’s Saturday afternoon and Josh has some downtime so he’s laying back on the couch watching some football. He’s not particularly interested in the result so he’s got his IM open on his laptop and he’s texting his friends planning his Saturday night entertainment.

Then the BattFone goes off. Adam receives a Twitter DM alerting him to a Social Action hot off the wires from Idealist.org. There’s an asylum seeker at the local welfare centre and they need a translator in a hurry. Just so happens Adam speaks “foreign” and so without much ado he’s down there spending less than an hour making someone’s life a lot easier.

Adam is the type of guy who’ll answer a call for help but he’s not always going to go out of his way to look for the needy. That’s where BattFone comes in.

***

We want BattFone to be considered the early warning alert system for the Social Actions. An APB for the API.

We aim to combine the Social Actions API with Twitter and eventually other networks  to create a multi-way Social Actions communications system. Using http://BattFone.me users will register to be alerted via Twitter, e-mail and other means when actions they’ve specified an interest in are created.

BattFone is a filter and alert system to get the right Social Actions to the right Social Actors at the right time.
The right time isn’t always quarter a after midnight during a surfing session. It can be whenever and wherever the Action is created.

BattFone is focused heavily on the end-user. It’s main purpose is to act as an instigator of real world action. We want to take relevant Social Actions off the social networks and put them into the hands of people who will answer the call for help.

We expect BattFone to be most useful in urban environments where rich sets of actions will be targeted at the most focused set of actors possible. As the Social Actions API develops we expect location awareness to play a key role. Right now however we’re working with what we can in this regard.

Great Idea, now go build it

Battfone Development work

Part of my day job at Setanta involves designing and managing the build of applications far more complex than the one above. So Battfone was going to be a piece of cake, even for a someone like myself who doesn’t usually get their hand covered with code feces. Wrong.

First up was designing a model. The concept is straightforward enough.

  1. A user registers interest in receiving Battfone alerts
  2. User provides Twitter ID and states what action types they want to help with along with their location
  3. Battfone polls Social Actions’ API regulary
  4. Battfone matches new Social Actions’ location and action_type with user location and action type.
  5. If there’s a match we compose a tweet and dm the lucky user
bingo

After taking the app through some bigtime thought revisions the bones remain pretty much as is. The order of that if statement has changed but the result is the same.

So with a model sketched out in too-soft-for-my-liking-HB pencil it was on to the application stack itself. One given was that the app was going to be hosted by Joyent. I’ve had nothing but great customer support there over the past few years and already have a ton of small blogs (including this one) safely housed there.
Next up the stack itself. One of the great rules set down by the guys at Social Actions is that all the apps end up published with an Open Source license. Add to that that to kick off there’s only going to be one developer working on this and there goes a .NET stack.

Second contributing factor was the APIs that were going to be integrated; Twitter and Social Actions. Twitter in particular has a ton of libraries and documented code snippets already built for it. Social Actions is getting there. To utilize these my choices were down to Python, PHP, Java and Ruby. I played around with Python for a while but eventually settled on Ruby. With Rails I could scaffold a working database model (I thought at the time) quickly, not worry about the front end design until way later, and concentrate my efforts on the app brains of matching social_actions with users.

I’d like to have investigated Django a little more. I really like what the guys there are building but there’s simply a lot more Rails examples and tutorial out there right now and if I was going to build this, or at least a proof of concept, on my own I was going to need to tap into the crowd wisdom already on the net.

What’s taking you so long?

I’m going to save an actual code overview for another time. Some big problems I’ve faced so far aren’t issues with my conceptual problems, but simply knowledge gaps associated with using any stack for the first time, in my case Rails. It took the best part of a week of evening to get MySQL’s local paths sorted on my dev environment. Twitter has been turning OAuth on and off for the last month meaning that testing any Twitter functionality has been hit or miss. It’s still out and I’m not sure it’s worth the hassle to re-engineer Battfone to handle password logins that are soon the be deprecated anyway.

Twitter

Right now I’m at the stage where I have just about every individual class working independently.  I have a scaffolded app running with a few bugs and I’m trying to add in the classes and functionality one by one. I’ve no front end work done but that’s the fun part so I’ll sail through that in a couple of nights.

If there has been one hold back on the API side though it’s been with the location attributes of each social_action coming through the Social Actions API itself. For the vast majority of actions the location attribute is not set at all. This makes sense in many cases, why should a petition for example need a real world location set for it. However in the case where locations are set they are not always easy to parse and match up with a user. I know this issue is still under development on the API side and it hasn’t stopped John Brennan building his fantastic Google Maps mashup at http://www.imdoingmypart.org/community/map.

imdoingmypart.org

imdoingmypart.org

I can only commend Joe and Peter from Social Actions who have been super encouraging during the whole process. One of their aims with the competition has been to incubate a developer community around the API and that’s certainly happened.

So onwards!

There’s alot more to come on the onwards applications of Battfone, I’m hoping to have a working version online in the next couple of weeks. You can follow the test Twitter account @battfone to get a good idea of the state of play. And of course if you have any feedback, ideas, offers of free coders and so on please shout.